This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
getcwd() problem
- To: <cygwin at cygwin dot com>
- Subject: getcwd() problem
- From: Yasushi Higuchi <yzone at mail dot raidway dot ne dot jp>
- Date: Fri, 5 Oct 2001 21:13:31 +0900 (JST)
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/