Mail Archives: djgpp-workers/1996/04/25/05:36:40
On Fri, 29 Mar 1996, DJ Delorie wrote:
> Comments, anyone? These claim to handle .orig and .rej files better
> than the existing one.
It *is* better. (I only applied the patches to sources, didn't try the
patches to configure and Makefile.) I tested this with a complicated
patch to Texinfo, and a long patch to Emacs which I knew would fail in
some places (because the diffs were taken relative to old sources). The
patched version passed the test with flying colors, correctly creating
reject file where it should. The original version failed to create
reject file (it tried to create it with a name that's illegal under DOS)
and also eat up the first character of some files when producing backup
files (e.g., the backup for "makefile.dj" would be called "akefile.dj~").
I suggest to also apply the following simple patch. It isn't strictly
required to have a working program, but it's nice to end up in the same
directory when `patch' finishes, even if you give -d switch.
There is also a couple of patches to `patch' posted lately to
bug-gnu-utils that I think should be applied when the new port is built.
If anybody wants, I can mail those additional patches.
*** patch-2.1/patch.c~1 Sat Apr 20 16:30:04 1996
--- patch-2.1/patch.c Wed Apr 24 16:42:24 1996
***************
*** 123,128 ****
--- 123,133 ----
/* TRUE if -R was specified on command line. */
static int reverse_flag_specified = FALSE;
+ #ifdef __MSDOS__
+ /* Remember where we started to end up there. */
+ static char *origwd;
+ #endif
+
/* Apply a set of diffs as appropriate. */
int
***************
*** 430,435 ****
--- 435,445 ----
}
set_signals(1);
}
+ #ifdef __MSDOS__
+ /* In case -d was given, return to where we started. */
+ if (origwd)
+ chdir (origwd);
+ #endif
my_exit(failtotal);
}
***************
*** 535,540 ****
--- 545,553 ----
diff_type = CONTEXT_DIFF;
break;
case 'd':
+ #ifdef __MSDOS__
+ origwd = getcwd (0, FILENAME_MAX);
+ #endif
if (chdir(optarg) < 0)
pfatal2("can't cd to %s", optarg);
break;
- Raw text -