[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [patch] gtkfind for HURD



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 brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



Reply to: