commit - dbb53e688c7b233eb214106e4d002f5b1ae057e6
commit + f499f7c795a9363b63dc548229e30616b5a4de80
blob - 27d1876b236caaad7b2b088b6db0be96a2a0c7a5
blob + d4d9b7779192d0c57410fae5e0c322aba8c71f03
--- rover.c
+++ rover.c
try_to_sel(const char *target)
{
ESEL = 0;
+ if (!ISDIR(target))
+ while ((ESEL+1) < rover.nfiles && ISDIR(ENAME(ESEL)))
+ ESEL++;
while ((ESEL+1) < rover.nfiles && strcoll(ENAME(ESEL), target) < 0)
ESEL++;
if (rover.nfiles > HEIGHT) {
} else if (!strcmp(key, RVK_RENAME)) {
int ok = 0;
char *prompt = "rename: ";
+ char *last;
+ int isdir;
strcpy(INPUT, ENAME(ESEL));
+ last = INPUT + strlen(INPUT) - 1;
+ if ((isdir = *last == '/'))
+ *last = '\0';
update_input(prompt, RED);
while (igetstr(INPUT, INPUTSZ)) {
int length = strlen(INPUT);
}
clear_message();
if (strlen(INPUT)) {
+ if (isdir)
+ strcat(INPUT, "/");
if (ok) {
if (!rename(ENAME(ESEL), INPUT) && MARKED(ESEL)) {
del_mark(&rover.marks, ENAME(ESEL));