Keep name unchanged at rename to duplicate

This commit is contained in:
Arun Prakash Jana 2019-08-19 19:58:37 +05:30
parent bf13243830
commit f378743c49
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -4235,15 +4235,10 @@ nochange:
tmp = xreadline(NULL, "name/link suffix [@ for none]: ");
break;
default: /* SEL_RENAME */
dup = get_input("Press 'r'(ename) / 'd'(uplicate)");
if (dup == 'r' || dup == 'd') {
tmp = xreadline(dents[cur].name, "");
break;
}
tmp = NULL;
}
if (!tmp || !*tmp)
break;
@ -4278,8 +4273,13 @@ nochange:
break;
case SEL_RENAME:
/* Skip renaming to same name */
if (strcmp(tmp, dents[cur].name) == 0) {
tmp = xreadline(dents[cur].name, "copy name: ");
if (strcmp(tmp, dents[cur].name) == 0)
goto nochange;
dup = 'd';
}
break;
default:
break;