On Mon, Sep 17, 2001 at 07:39:14PM -0700, James Morrison wrote:
> PACKAGE: gtkfind
> VERSION: 1.0.1-1
> SEVERITY: important
> 
>  Here is a patch that allows gtkfind to compile and run, so far, 
> on GNU (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. 

BTW, I think that in some cases it is better to just drop the distinction
between MAXPATHLEN case and non-MAXPATHLEN, and just use the dynamic code on
all platforms.  This removes ifdefs.  But I haven't looked to closely at
that part of the patch if this is better in this case or not.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de


Reply via email to