1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

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.
This commit is contained in:
Mark Murray 1996-04-11 10:13:40 +00:00
parent b32a8a24d9
commit 2bff10e8b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15195

View File

@ -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)