Re: [patch] gtkfind for HURD
> The following code is wrong:
>
> +#ifdef __GLIBC__
> + cwd = get_current_dir_name();
> +#else
> + getcwd(cwd,MAXPATHLEN);
> +#endif
>
> - if(getcwd(cwd, MAXPATHLEN) == NULL) {
> + if( cwd == NULL ) {
>
> getcwd doesn't set cwd to NULL on failure, it just returns NULL.
>
I think I only removed the MAXPATHLEN case once, but I'll check again
since you are probably right. However for this once should it be:
#ifdef __GLIBC__
if ( (cwd = get_current_dir_name()) == NULL ) {
#else
if ( getcwd(cwd,MAXPATHLEN) == NULL ) {
#endif
=====
James Morrison
University of Waterloo
Computer Science - Digital Hardware
2A co-op
__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/
Reply to: