This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getcwd() problem


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]