summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2015-07-21 22:57:27 +0000
committerConrad Meyer <cem@FreeBSD.org>2015-07-21 22:57:27 +0000
commit300ca9a86e0642c9f9285ace20fbb7f4d2695ba8 (patch)
tree50b34deb0ada9be639c3001fb8ac0499a39695a8 /usr.bin/patch/patch.c
parente637a6e3f940ad35e82ea0d8183a677697557802 (diff)
Notes
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 22f302741aea..b061041dd053 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -109,6 +109,8 @@ static bool remove_empty_files = false;
/* true if -R was specified on command line. */
static bool reverse_flag_specified = false;
+static bool Vflag = false;
+
/* buffer holding the name of the rejected patch file. */
static char rejname[NAME_MAX + 1];
@@ -201,7 +203,7 @@ main(int argc, char *argv[])
Argv = argv;
get_some_switches();
- if (backup_type == none) {
+ if (!Vflag) {
if ((v = getenv("PATCH_VERSION_CONTROL")) == NULL)
v = getenv("VERSION_CONTROL");
if (v != NULL || !posix)
@@ -595,6 +597,7 @@ get_some_switches(void)
break;
case 'V':
backup_type = get_version(optarg);
+ Vflag = true;
break;
#ifdef DEBUGGING
case 'x':
@@ -631,8 +634,8 @@ usage(void)
fprintf(stderr,
"usage: patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory]\n"
" [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count]\n"
-" [-r rej-name] [-V t | nil | never] [-x number] [-z backup-ext]\n"
-" [--posix] [origfile [patchfile]]\n"
+" [-r rej-name] [-V t | nil | never | none] [-x number]\n"
+" [-z backup-ext] [--posix] [origfile [patchfile]]\n"
" patch <patchfile\n");
my_exit(EXIT_FAILURE);
}