]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/patch/patches/patch-2.6.1-backup-if-mismatch.patch
patch: Update to 2.6.1 add selinux support.
[people/ms/ipfire-3.x.git] / pkgs / patch / patches / patch-2.6.1-backup-if-mismatch.patch
1 diff -up patch-2.6.1/src/patch.c.backup-if-mismatch patch-2.6.1/src/patch.c
2 --- patch-2.6.1/src/patch.c.backup-if-mismatch 2011-02-16 16:43:54.575850844 +0000
3 +++ patch-2.6.1/src/patch.c 2011-02-16 16:44:56.907995789 +0000
4 @@ -106,6 +106,7 @@ main (int argc, char **argv)
5 char numbuf[LINENUM_LENGTH_BOUND + 1];
6 bool written_to_rejname = false;
7 bool apply_empty_patch = false;
8 + bool posixly_correct_set;
9
10 exit_failure = 2;
11 program_name = argv[0];
12 @@ -125,7 +126,7 @@ main (int argc, char **argv)
13 i < 0 ? shell_quoting_style : (enum quoting_style) i);
14 }
15
16 - posixly_correct = getenv ("POSIXLY_CORRECT") != 0;
17 + posixly_correct_set = posixly_correct = getenv ("POSIXLY_CORRECT") != 0;
18 backup_if_mismatch = ! posixly_correct;
19 patch_get = ((val = getenv ("PATCH_GET"))
20 ? numeric_string (val, true, "PATCH_GET value")
21 @@ -151,6 +152,10 @@ main (int argc, char **argv)
22 Argv = argv;
23 get_some_switches();
24
25 + /* Let --posix cause --no-backup-if-mismatch. */
26 + if (! posixly_correct_set && posixly_correct && backup_if_mismatch)
27 + backup_if_mismatch = false;
28 +
29 if (make_backups | backup_if_mismatch)
30 backup_type = get_version (version_control_context, version_control);
31