diff options
author | markm <markm@FreeBSD.org> | 1996-04-11 10:13:40 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1996-04-11 10:13:40 +0000 |
commit | 414db770b68b564ca18c187735e992086a5c940f (patch) | |
tree | e935edc8ba58a36dd1f6e7db1e5495c1391ed22a /gnu/usr.bin | |
parent | df91e3aacd3fc80c5cdc830f24c24e8a156a3ec6 (diff) | |
download | FreeBSD-src-414db770b68b564ca18c187735e992086a5c940f.zip FreeBSD-src-414db770b68b564ca18c187735e992086a5c940f.tar.gz |
Priorities were broken. If there was an Index: line and ***/--- lines
with valid names, the ***/---names were taken first.
this broke eg:
Index: foo/Makefile
==========
RCS <blah>
Retrieving <blah>
diff <blah>
*** Makefile <blah>
--- Makefile <blah>
By trying to patch the Makefile in the _curent_ directory, rather than
the one in the foo/ directory.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/patch/pch.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gnu/usr.bin/patch/pch.c b/gnu/usr.bin/patch/pch.c index 0a40bfa..1598522 100644 --- a/gnu/usr.bin/patch/pch.c +++ b/gnu/usr.bin/patch/pch.c @@ -1,6 +1,13 @@ -/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.c,v 1.5 1995/05/30 05:02:35 rgrimes Exp $ +/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.c,v 1.6 1995/09/14 04:33:35 gibbs Exp $ * * $Log: pch.c,v $ + * Revision 1.6 1995/09/14 04:33:35 gibbs + * Give "Index" specified filenames preference over other filenames specified + * in the diff. This makes it so that diffs containing files in different + * subdirectories that have the same name not patch the same file. For example + * a diff with patches to Makefile, des/Makefile, usr.bin/Makefile would attempt + * to patch Makefile three times. + * * Revision 1.5 1995/05/30 05:02:35 rgrimes * Remove trailing whitespace. * @@ -352,14 +359,14 @@ intuit_diff_type() oldname = fetchname(oldtmp, strippath, ok_to_create_file); if (newtmp != Nullch) newname = fetchname(newtmp, strippath, ok_to_create_file); - if (oldname && newname) { + if (indname) + filearg[0] = savestr(indname); + else if (oldname && newname) { if (strlen(oldname) < strlen(newname)) filearg[0] = savestr(oldname); else filearg[0] = savestr(newname); } - else if (indname) - filearg[0] = savestr(indname); else if (oldname) filearg[0] = savestr(oldname); else if (newname) |