From: sof Date: Sat, 5 Jan 2002 11:28:31 +0000 (+0000) Subject: [project @ 2002-01-05 11:28:31 by sof] X-Git-Tag: Approximately_9120_patches~316 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a987c1f74b48c38736b2831fb79ffe6873dd34bc;p=ghc-hetmet.git [project @ 2002-01-05 11:28:31 by sof] fix pathconf() usage --- diff --git a/ghc/lib/std/cbits/dirUtils.c b/ghc/lib/std/cbits/dirUtils.c index 604a911..e47ff17 100644 --- 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);