mirror of
https://https.git.savannah.gnu.org/git/patch.git
synced 2026-01-27 01:44:34 +00:00
Set --no-backup-if-mismatch when in --posix mode
When in POSIX mode, the --no-backup-if-mismatch option should be enabled. However, this is only true when the POSIXLY_CORRECT environmant variable is set but not when the --posix command line option is given. Fix that by setting backup_if_mismatch after evaluating the command line arguments.
This commit is contained in:
parent
910fecf695
commit
5bac274507
@ -175,7 +175,6 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
posixly_correct = getenv ("POSIXLY_CORRECT") != 0;
|
||||
backup_if_mismatch = ! posixly_correct;
|
||||
patch_get = ((val = getenv ("PATCH_GET"))
|
||||
? numeric_string (val, true, "PATCH_GET value")
|
||||
: 0);
|
||||
@ -197,6 +196,7 @@ main (int argc, char **argv)
|
||||
if (set_utc && setenv ("TZ", "UTC0", 1) < 0)
|
||||
pfatal ("setenv");
|
||||
|
||||
backup_if_mismatch = ! posixly_correct;
|
||||
if (make_backups | backup_if_mismatch)
|
||||
backup_type = get_version (version_control_context, version_control);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user