The rename(1) can exit early when replace expression and replacement are identical string. It is also appropriate to change return value in this case to 'nothing was renamed'. Signed-off-by: Sami Kerola <kerolasa@xxxxxx> --- misc-utils/rename.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc-utils/rename.c b/misc-utils/rename.c index a7671fa11..1cee40697 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -204,6 +204,9 @@ int main(int argc, char **argv) from = argv[0]; to = argv[1]; + if (!strcmp(from, to)) + return RENAME_EXIT_NOTHING; + for (i = 2; i < argc; i++) ret |= do_rename(from, to, argv[i], verbose, noact, nooverwrite); -- 2.13.1 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html