Browse Source

Revert "Fix clang error"

This reverts commit 78de6b5752.
master
Arun Prakash Jana 5 years ago
parent
commit
7133971052
1 changed files with 19 additions and 10 deletions
  1. +19
    -10
      src/nnn.c

+ 19
- 10
src/nnn.c 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() 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 settimeout() timeout(1000)
#define cleartimeout() timeout(-1) #define cleartimeout() timeout(-1)
#define errexit() printerr(__LINE__) #define errexit() printerr(__LINE__)
@@ -3299,7 +3299,8 @@ nochange:
presel = filterentries(path); presel = filterentries(path);


/* Save current */ /* Save current */
copycurname();
if (ndents)
copycurname();


if (presel == 27) { if (presel == 27) {
presel = 0; presel = 0;
@@ -3388,7 +3389,8 @@ nochange:
} }


/* Save current */ /* Save current */
copycurname();
if (ndents)
copycurname();
goto begin; goto begin;
case SEL_STATS: case SEL_STATS:
if (!ndents) if (!ndents)
@@ -3432,7 +3434,8 @@ nochange:
r = handle_archive(newpath, "-x", path); r = handle_archive(newpath, "-x", path);
break; break;
case SEL_REDRAW: case SEL_REDRAW:
copycurname();
if (ndents)
copycurname();
goto begin; goto begin;
case SEL_RENAMEALL: case SEL_RENAMEALL:
r = getutil(utils[VIDIR]); r = getutil(utils[VIDIR]);
@@ -3478,7 +3481,8 @@ nochange:
presel = FILTER; presel = FILTER;


/* Save current */ /* Save current */
copycurname();
if (ndents)
copycurname();


/* Repopulate as directory content may have changed */ /* Repopulate as directory content may have changed */
goto begin; goto begin;
@@ -3623,7 +3627,8 @@ nochange:


spawn("sh", "-c", g_buf, path, F_NORMAL); spawn("sh", "-c", g_buf, path, F_NORMAL);


copycurname();
if (ndents)
copycurname();
if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;
goto begin; goto begin;
@@ -3787,7 +3792,8 @@ nochange:


if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;
copycurname();
if (ndents)
copycurname();
goto begin; goto begin;
} else { } else {
close(fd); close(fd);
@@ -3926,7 +3932,8 @@ nochange:
presel = FILTER; presel = FILTER;


/* Save current */ /* Save current */
copycurname();
if (ndents)
copycurname();


/* Repopulate as directory content may have changed */ /* Repopulate as directory content may have changed */
goto begin; goto begin;
@@ -4002,7 +4009,8 @@ nochange:
if (xlines != LINES || xcols != COLS) { if (xlines != LINES || xcols != COLS) {
idle = 0; idle = 0;
setdirwatch(); setdirwatch();
copycurname();
if (ndents)
copycurname();
goto begin; goto begin;
} }


@@ -4010,7 +4018,8 @@ 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);
copycurname();
if (ndents)
copycurname();
goto begin; goto begin;
} }




Loading…
Cancel
Save