Source-Changes-HG archive

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

[src/netbsd-1-5]: src/usr.bin/patch Pull up revision 1.8 (requested by kleink):



details:   https://anonhg.NetBSD.org/src/rev/12e54ce0b5b2
branches:  netbsd-1-5
changeset: 490608:12e54ce0b5b2
user:      he <he%NetBSD.org@localhost>
date:      Sat Feb 03 20:57:41 2001 +0000

description:
Pull up revision 1.8 (requested by kleink):
  Support the 1003.2-92 -i option.   Fixes PR#11221.

diffstat:

 usr.bin/patch/patch.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 2cb8a4be11a4 -r 12e54ce0b5b2 usr.bin/patch/patch.c
--- a/usr.bin/patch/patch.c     Sat Feb 03 20:57:25 2001 +0000
+++ b/usr.bin/patch/patch.c     Sat Feb 03 20:57:41 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: patch.c,v 1.7 1998/11/06 22:40:13 christos Exp $       */
+/*     $NetBSD: patch.c,v 1.7.10.1 2001/02/03 20:57:41 he Exp $        */
 
 /* patch - a program to apply diffs to original files
  *
@@ -10,7 +10,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: patch.c,v 1.7 1998/11/06 22:40:13 christos Exp $");
+__RCSID("$NetBSD: patch.c,v 1.7.10.1 2001/02/03 20:57:41 he Exp $");
 #endif /* not lint */
 
 #include "INTERN.h"
@@ -424,6 +424,7 @@
       { "ignore-whitespace",   'l' },
       { "normal",              'n' },
       { "output",              'o' },
+      { "patchfile",           'i' },
       { "prefix",              'B' },
       { "quiet",               's' },
       { "reject-file",         'r' },
@@ -466,6 +467,9 @@
        if (*s != '-' || !s[1]) {
            if (filec == MAXFILEC)
                fatal1("too many file arguments\n");
+           if (filec == 1 && filearg[filec] != Nullch)
+               fatal1("-i option and patchfile argument are mutually\
+exclusive\n");
            filearg[filec++] = savestr(s);
        }
        else {
@@ -518,6 +522,11 @@
                    s++;
                maxfuzz = atoi(s);
                break;
+           case 'i':
+               if (filearg[1] != Nullch)
+                   free(filearg[1]);
+               filearg[1] = savestr(nextarg());
+               break;
            case 'l':
                canonicalize = TRUE;
                break;



Home | Main Index | Thread Index | Old Index