projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d62f02
)
[project @ 2002-01-05 11:28:31 by sof]
author
sof
<unknown>
Sat, 5 Jan 2002 11:28:31 +0000
(11:28 +0000)
committer
sof
<unknown>
Sat, 5 Jan 2002 11:28:31 +0000
(11:28 +0000)
fix pathconf() usage
ghc/lib/std/cbits/dirUtils.c
patch
|
blob
|
history
diff --git
a/ghc/lib/std/cbits/dirUtils.c
b/ghc/lib/std/cbits/dirUtils.c
index
604a911
..
e47ff17
100644
(file)
--- a/
ghc/lib/std/cbits/dirUtils.c
+++ b/
ghc/lib/std/cbits/dirUtils.c
@@
-88,11
+88,11
@@
prel_readdir(HsAddr dirPtr, HsAddr pDirEnt)
}
if (nm_max == -1) {
#ifdef NAME_MAX
- nm_max = NAME_MAX;
+ nm_max = NAME_MAX + 1;
#else
- char* res;
- nm_max = pathconf(res, _PC_NAME_MAX);
- if (nm_max == -1) { nm_max = 256; }
+ nm_max = pathconf(".", _PC_NAME_MAX);
+ if (nm_max == -1) { nm_max = 255; }
+ nm_max++;
#endif
}
p = (struct dirent*)malloc(sizeof(struct dirent) + nm_max);