projects
/
henge
/
apc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wip
[henge/apc.git]
/
src
/
scanner.c
diff --git
a/src/scanner.c
b/src/scanner.c
index
5c06a4e
..
14266ca
100644
(file)
--- a/
src/scanner.c
+++ b/
src/scanner.c
@@
-223,7
+223,11
@@
int dredge_current_depth
struct dirent* direntp;
DL_CD_INIT();
scan_next:
struct dirent* direntp;
DL_CD_INIT();
scan_next:
- if ((direntp = readdir(cwd)) != NULL)
+ errno = 0;
+ direntp = readdir(cwd);
+ if (errno)
+ return -1;
+ if (direntp != NULL)
{ switch (direntp->d_type)
{ case DT_REG:
DPS_PUSH(direntp);
{ switch (direntp->d_type)
{ case DT_REG:
DPS_PUSH(direntp);
@@
-239,8
+243,6
@@
int dredge_current_depth
goto scan_next;
}
}
goto scan_next;
}
}
- if (errno)
- return -1;
qsort(lexer_direntpa, DPS_LEN(), sizeof direntp, (qcomp)alphasort);
return DPS_LEN();
}
qsort(lexer_direntpa, DPS_LEN(), sizeof direntp, (qcomp)alphasort);
return DPS_LEN();
}