From: G.raud Meyer Date: Thu, 29 Mar 2018 10:58:44 +0000 (+0200) Subject: rename: prevent --no-act from setting --no-overwrite X-Git-Tag: v2.33-rc1~322^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0849ff36605588a7ab7892ab2aae59d73290e225;p=thirdparty%2Futil-linux.git rename: prevent --no-act from setting --no-overwrite This fixes a bug introduced by commit fabb90676 ("Added --no-override option to rename.", 2017-05-27) where the fallthrough meant to let --no-act set --verbose was changed to set --no-override (the previous code was too smart). Do not let --no-act set --verbose anymore but update the manual to recommend adding option --verbose. This is to be able to make --no-act detect only non existing file arguments (in a future commit). --- diff --git a/misc-utils/rename.1 b/misc-utils/rename.1 index d476d2435f..df329461b4 100644 --- a/misc-utils/rename.1 +++ b/misc-utils/rename.1 @@ -23,7 +23,9 @@ Do not rename a symlink but its target. Show which files were renamed, if any. .TP .BR \-n , " \-\-no\-act" -Do not make any changes. +Do not make any changes; add +.BR \-\-verbose +to see what would be made. .TP .BR \-o , " \-\-no\-overwrite" Do not overwrite existing files. When diff --git a/misc-utils/rename.c b/misc-utils/rename.c index 1d280add37..147e54fe92 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -174,13 +174,13 @@ int main(int argc, char **argv) switch (c) { case 'n': noact = 1; - /* fallthrough */ - case 'o': - nooverwrite = 1; - break; + break; case 'v': verbose = 1; break; + case 'o': + nooverwrite = 1; + break; case 's': do_rename = do_symlink; break;