Mail Archives: djgpp/1996/02/26/12:43:23
GNU Find 4.1 as distributed with find41b.zip has 3 bugs:
1) It doesn't map correctly the exit status of child programs
(run with -exec) to the true/false values; thus it sometimes will process
files it shouldn't have.
2) It fails to restore the current directory after running a
child process; thus it will complain about nonexistent files when
recursively descenting a directory.
3) It doesn't know about any filesystem type except ``unknown''.
The following simple patches take care of all of the above. You should
run configur.bat file after applying these patches, before invoking Make.
*** gnu/findu41/config.d~0 Mon Nov 6 04:01:04 1995
--- gnu/findu41/config.dj Mon Feb 26 19:07:30 1996
***************
*** 1 ****
--- 1,5 ----
#include <sys/config.h>
+
+ #ifndef FSTYPE_MNTENT
+ #define FSTYPE_MNTENT 1
+ #endif
*** gnu/findu41/find/pred.c~0 Mon Nov 6 03:55:50 1995
--- gnu/findu41/find/pred.c Mon Feb 26 18:24:50 1996
***************
*** 1335,1342 ****
fflush (stderr);
#ifdef __MSDOS__
! return spawnvp(P_WAIT, execp->vec[0], execp->vec);
! #else
/* Make sure to listen for the kids. */
if (first_time)
{
--- 1335,1368 ----
fflush (stderr);
#ifdef __MSDOS__
!
! /* On MS-DOS, CWD is global, so we must remember where we were
! before spawning a child, and return there after the child exits. */
! {
! char *cwd = xgetcwd ();
!
! if (chdir (starting_dir) < 0)
! {
! error (0, errno, "%s", starting_dir);
! _exit (1);
! }
!
! status = spawnvp(P_WAIT, execp->vec[0], execp->vec);
!
! if (status == -1)
! error (0, errno, "%s", execp->vec[0]);
!
! if (chdir (cwd) < 0)
! {
! error (0, errno, "%s", cwd);
! _exit (1);
! }
!
! return (status == 0 ? true : false);
! }
!
! #else /* not __MSDOS__ */
!
/* Make sure to listen for the kids. */
if (first_time)
{
***************
*** 1396,1402 ****
return (false);
}
return (!WEXITSTATUS (status));
! #endif
}
/* Return a static string formatting the time WHEN according to the
--- 1422,1428 ----
return (false);
}
return (!WEXITSTATUS (status));
! #endif /* not __MSDOS__ */
}
/* Return a static string formatting the time WHEN according to the
- Raw text -