mirror of
https://github.com/jarun/nnn.git
synced 2024-11-16 08:03:16 +00:00
Fix clang error
This commit is contained in:
parent
d2865de329
commit
78de6b5752
29
src/nnn.c
29
src/nnn.c
|
@ -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,8 +3301,7 @@ nochange:
|
||||||
presel = filterentries(path);
|
presel = filterentries(path);
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
copycurname();
|
||||||
copycurname();
|
|
||||||
|
|
||||||
if (presel == 27) {
|
if (presel == 27) {
|
||||||
presel = 0;
|
presel = 0;
|
||||||
|
@ -3391,8 +3390,7 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
copycurname();
|
||||||
copycurname();
|
|
||||||
goto begin;
|
goto begin;
|
||||||
case SEL_STATS:
|
case SEL_STATS:
|
||||||
if (!ndents)
|
if (!ndents)
|
||||||
|
@ -3436,8 +3434,7 @@ 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:
|
||||||
r = getutil(utils[VIDIR]);
|
r = getutil(utils[VIDIR]);
|
||||||
|
@ -3483,8 +3480,7 @@ 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 */
|
||||||
goto begin;
|
goto begin;
|
||||||
|
@ -3629,8 +3625,7 @@ 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;
|
||||||
goto begin;
|
goto begin;
|
||||||
|
@ -3794,8 +3789,7 @@ nochange:
|
||||||
|
|
||||||
if (cfg.filtermode)
|
if (cfg.filtermode)
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
if (ndents)
|
copycurname();
|
||||||
copycurname();
|
|
||||||
goto begin;
|
goto begin;
|
||||||
} else {
|
} else {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
@ -3934,8 +3928,7 @@ 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 */
|
||||||
goto begin;
|
goto begin;
|
||||||
|
@ -4011,8 +4004,7 @@ 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,8 +4012,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue