aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-21 15:41:26 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-21 15:41:26 +0530
commit71339710528d15805f23a719cc27ef36fa037395 (patch)
tree50559b351e1cbaa5a34249088eb763070eee874f /src/nnn.c
parentb059e08f3af1819d957c831b92318dd724a67137 (diff)
downloadnnn-71339710528d15805f23a719cc27ef36fa037395.tar.gz
Revert "Fix clang error"
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/nnn.c b/src/nnn.c
index fdc6f3e..419f066 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -459,7 +459,7 @@ static struct timespec gtimeout;
#define clearprompt() printmsg("")
#define printwarn() printmsg(strerror(errno))
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
-#define copycurname() if (ndents) xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1)
+#define copycurname() xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1)
#define settimeout() timeout(1000)
#define cleartimeout() timeout(-1)
#define errexit() printerr(__LINE__)
@@ -3299,7 +3299,8 @@ nochange:
presel = filterentries(path);
/* Save current */
- copycurname();
+ if (ndents)
+ copycurname();
if (presel == 27) {
presel = 0;
@@ -3388,7 +3389,8 @@ nochange:
}
/* Save current */
- copycurname();
+ if (ndents)
+ copycurname();
goto begin;
case SEL_STATS:
if (!ndents)
@@ -3432,7 +3434,8 @@ nochange:
r = handle_archive(newpath, "-x", path);
break;
case SEL_REDRAW:
- copycurname();
+ if (ndents)
+ copycurname();
goto begin;
case SEL_RENAMEALL:
r = getutil(utils[VIDIR]);
@@ -3478,7 +3481,8 @@ nochange:
presel = FILTER;
/* Save current */
- copycurname();
+ if (ndents)
+ copycurname();
/* Repopulate as directory content may have changed */
goto begin;
@@ -3623,7 +3627,8 @@ nochange:
spawn("sh", "-c", g_buf, path, F_NORMAL);
- copycurname();
+ if (ndents)
+ copycurname();
if (cfg.filtermode)
presel = FILTER;
goto begin;
@@ -3787,7 +3792,8 @@ nochange:
if (cfg.filtermode)
presel = FILTER;
- copycurname();
+ if (ndents)
+ copycurname();
goto begin;
} else {
close(fd);
@@ -3926,7 +3932,8 @@ nochange:
presel = FILTER;
/* Save current */
- copycurname();
+ if (ndents)
+ copycurname();
/* Repopulate as directory content may have changed */
goto begin;
@@ -4002,7 +4009,8 @@ nochange:
if (xlines != LINES || xcols != COLS) {
idle = 0;
setdirwatch();
- copycurname();
+ if (ndents)
+ copycurname();
goto begin;
}
@@ -4010,7 +4018,8 @@ nochange:
if (idletimeout && idle == idletimeout) {
idle = 0;
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL);
- copycurname();
+ if (ndents)
+ copycurname();
goto begin;
}