From 2d8b453009feac6e3b71c0bca4a5d15acdc746ad Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 22 Jan 1998 07:44:04 +0000 Subject: Add PATCH_INDEX_FIRST environment variable to do the same as -I option --- gnu/usr.bin/patch/patch.1 | 9 ++++++++- gnu/usr.bin/patch/patch.c | 12 +++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'gnu/usr.bin/patch') diff --git a/gnu/usr.bin/patch/patch.1 b/gnu/usr.bin/patch/patch.1 index fccb799..51b3b09 100644 --- a/gnu/usr.bin/patch/patch.1 +++ b/gnu/usr.bin/patch/patch.1 @@ -1,8 +1,12 @@ .\" -*- nroff -*- .rn '' }` -'\" $Header: /home/ncvs/src/gnu/usr.bin/patch/patch.1,v 1.7 1998/01/21 14:37:21 ache Exp $ +'\" $Header: /home/ncvs/src/gnu/usr.bin/patch/patch.1,v 1.8 1998/01/21 15:10:13 ache Exp $ '\" '\" $Log: patch.1,v $ +'\" Revision 1.8 1998/01/21 15:10:13 ache +'\" Add -I or --index-first option to take Index: precedence over context diff, +'\" as it was in hacked FreeBSD version +'\" '\" Revision 1.7 1998/01/21 14:37:21 ache '\" Resurrect patch 2.1 without FreeBSD Index: hack '\" @@ -342,6 +346,9 @@ the number of lines of context in the context diff, ordinarily 3. forces .I patch to take ``Index:'' line precedence over context diff header. +The same effect have +.B PATCH_INDEX_FIRST +environment variable if present. .TP 5 .B "\-l, \-\-ignore\-whitespace" causes the pattern matching to be done loosely, in case the tabs and diff --git a/gnu/usr.bin/patch/patch.c b/gnu/usr.bin/patch/patch.c index c3acfc7..e372ad3 100644 --- a/gnu/usr.bin/patch/patch.c +++ b/gnu/usr.bin/patch/patch.c @@ -1,5 +1,5 @@ char rcsid[] = - "$Header: /home/ncvs/src/gnu/usr.bin/patch/patch.c,v 1.12 1998/01/21 15:10:13 ache Exp $"; + "$Header: /home/ncvs/src/gnu/usr.bin/patch/patch.c,v 1.13 1998/01/21 15:15:39 ache Exp $"; /* patch - a program to apply diffs to original files * @@ -9,6 +9,9 @@ char rcsid[] = * money off of it, or pretend that you wrote it. * * $Log: patch.c,v $ + * Revision 1.13 1998/01/21 15:15:39 ache + * Update usage line with new option + * * Revision 1.12 1998/01/21 15:10:13 ache * Add -I or --index-first option to take Index: precedence over context diff, * as it was in hacked FreeBSD version @@ -179,8 +182,9 @@ static int reverse_flag_specified = FALSE; /* TRUE if -C was specified on command line. */ int check_patch = FALSE; -/* TRUE if -I was specified on command line. */ -int index_first = FALSE; +/* TRUE if -I was specified on command line */ +/* or PATCH_INDEX_FIRST env. variable is set */ +int index_first; /* Apply a set of diffs as appropriate. */ @@ -205,6 +209,8 @@ char **argv; myuid = getuid(); + index_first = getenv ("PATCH_INDEX_FIRST") != 0; + /* Cons up the names of the temporary files. */ { /* Directory for temporary files. */ -- cgit v1.1