Fix clang error

This commit is contained in:
Arun Prakash Jana 2019-04-21 12:05:56 +05:30
parent d2865de329
commit 78de6b5752

View file

@ -459,7 +459,7 @@ static struct timespec gtimeout;
#define clearprompt() printmsg("") #define clearprompt() printmsg("")
#define printwarn() printmsg(strerror(errno)) #define printwarn() printmsg(strerror(errno))
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/') #define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
#define copycurname() xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1) #define copycurname() if (ndents) xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1)
#define settimeout() timeout(1000) #define settimeout() timeout(1000)
#define cleartimeout() timeout(-1) #define cleartimeout() timeout(-1)
#define errexit() printerr(__LINE__) #define errexit() printerr(__LINE__)
@ -3301,7 +3301,6 @@ nochange:
presel = filterentries(path); presel = filterentries(path);
/* Save current */ /* Save current */
if (ndents)
copycurname(); copycurname();
if (presel == 27) { if (presel == 27) {
@ -3391,7 +3390,6 @@ nochange:
} }
/* Save current */ /* Save current */
if (ndents)
copycurname(); copycurname();
goto begin; goto begin;
case SEL_STATS: case SEL_STATS:
@ -3436,7 +3434,6 @@ nochange:
r = handle_archive(newpath, "-x", path); r = handle_archive(newpath, "-x", path);
break; break;
case SEL_REDRAW: case SEL_REDRAW:
if (ndents)
copycurname(); copycurname();
goto begin; goto begin;
case SEL_RENAMEALL: case SEL_RENAMEALL:
@ -3483,7 +3480,6 @@ nochange:
presel = FILTER; presel = FILTER;
/* Save current */ /* Save current */
if (ndents)
copycurname(); copycurname();
/* Repopulate as directory content may have changed */ /* Repopulate as directory content may have changed */
@ -3629,7 +3625,6 @@ nochange:
spawn("sh", "-c", g_buf, path, F_NORMAL); spawn("sh", "-c", g_buf, path, F_NORMAL);
if (ndents)
copycurname(); copycurname();
if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;
@ -3794,7 +3789,6 @@ nochange:
if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;
if (ndents)
copycurname(); copycurname();
goto begin; goto begin;
} else { } else {
@ -3934,7 +3928,6 @@ nochange:
presel = FILTER; presel = FILTER;
/* Save current */ /* Save current */
if (ndents)
copycurname(); copycurname();
/* Repopulate as directory content may have changed */ /* Repopulate as directory content may have changed */
@ -4011,7 +4004,6 @@ nochange:
if (xlines != LINES || xcols != COLS) { if (xlines != LINES || xcols != COLS) {
idle = 0; idle = 0;
setdirwatch(); setdirwatch();
if (ndents)
copycurname(); copycurname();
goto begin; goto begin;
} }
@ -4020,7 +4012,6 @@ nochange:
if (idletimeout && idle == idletimeout) { if (idletimeout && idle == idletimeout) {
idle = 0; idle = 0;
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL); spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL);
if (ndents)
copycurname(); copycurname();
goto begin; goto begin;
} }