getcwd() problem
Yasushi Higuchi
yzone@mail.raidway.ne.jp
Fri Oct 5 05:13:00 GMT 2001
Hello.
I found a problem in the getcwd() function in recent snapshot.
>$ cat getcwd.c
>#include <stdio.h>
>#include <string.h>
>#include <unistd.h>
>int
>main(void)
>{
> char *cwd = getcwd(NULL, 256);
> if (cwd == NULL)
> fprintf(stderr, "null\n");
> else {
> fprintf(stderr, "[%s]\n", cwd);
> free(cwd);
> }
> return 0;
>}
== Cygwin 1.3.3
>$ ./getcwd
>[/home/work/cygwin]
== 20011005 snapshot
>$ ./getcwd
>null
I think that a former movement is right.
Reference: FreeBSD manpages
>STANDARDS
>The getcwd() function conforms to ISO 9899: 1990 (``ISO C''). The ability
>to specify a NULL pointer and have getcwd() allocate memory as necessary
>is an extension.
--
Yasushi HIGUCHI
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list