=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/patch.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- src/usr.bin/patch/patch.c 2023/10/25 20:05:43 1.75 +++ src/usr.bin/patch/patch.c 2024/03/22 19:22:23 1.76 @@ -1,4 +1,4 @@ -/* $OpenBSD: patch.c,v 1.75 2023/10/25 20:05:43 bluhm Exp $ */ +/* $OpenBSD: patch.c,v 1.76 2024/03/22 19:22:23 jcs Exp $ */ /* * patch - a program to apply diffs to original files @@ -109,6 +109,8 @@ /* 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[PATH_MAX]; @@ -255,7 +257,7 @@ my_exit(2); } - if (backup_type == none) { + if (!Vflag) { if ((v = getenv("PATCH_VERSION_CONTROL")) == NULL) v = getenv("VERSION_CONTROL"); if (v != NULL || !posix) @@ -641,6 +643,7 @@ break; case 'V': backup_type = get_version(optarg); + Vflag = true; break; #ifdef DEBUGGING case 'x': @@ -677,8 +680,8 @@ 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