mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Remove redundant variable
This commit is contained in:
parent
04bf7537e5
commit
a451e74465
19
nnn.c
19
nnn.c
|
@ -2150,7 +2150,7 @@ browse(char *ipath, char *ifilter)
|
||||||
{
|
{
|
||||||
static char path[PATH_MAX], oldpath[PATH_MAX], newpath[PATH_MAX], lastdir[PATH_MAX], mark[PATH_MAX];
|
static char path[PATH_MAX], oldpath[PATH_MAX], newpath[PATH_MAX], lastdir[PATH_MAX], mark[PATH_MAX];
|
||||||
static char fltr[LINE_MAX];
|
static char fltr[LINE_MAX];
|
||||||
char *dir, *tmp, *run = NULL, *env = NULL, *dstdir = NULL;
|
char *dir, *tmp, *run = NULL, *env = NULL;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int r, fd, presel;
|
int r, fd, presel;
|
||||||
enum action sel = SEL_RUNARG + 1;
|
enum action sel = SEL_RUNARG + 1;
|
||||||
|
@ -2479,22 +2479,20 @@ nochange:
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
}
|
||||||
case SEL_CDHOME:
|
case SEL_CDHOME:
|
||||||
dstdir = getenv("HOME");
|
dir = getenv("HOME");
|
||||||
if (dstdir == NULL) {
|
if (dir == NULL) {
|
||||||
clearprompt();
|
clearprompt();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
} // fallthrough
|
} // fallthrough
|
||||||
case SEL_CDBEGIN:
|
case SEL_CDBEGIN:
|
||||||
if (!dstdir)
|
if (sel == SEL_CDBEGIN)
|
||||||
dstdir = ipath;
|
dir = ipath;
|
||||||
|
|
||||||
if (!xdiraccess(dstdir)) {
|
if (!xdiraccess(dir)) {
|
||||||
dstdir = NULL;
|
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xstrcmp(path, dstdir) == 0) {
|
if (xstrcmp(path, dir) == 0) {
|
||||||
dstdir = NULL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2502,14 +2500,13 @@ nochange:
|
||||||
xstrlcpy(lastdir, path, PATH_MAX);
|
xstrlcpy(lastdir, path, PATH_MAX);
|
||||||
dir_changed = TRUE;
|
dir_changed = TRUE;
|
||||||
|
|
||||||
xstrlcpy(path, dstdir, PATH_MAX);
|
xstrlcpy(path, dir, PATH_MAX);
|
||||||
oldpath[0] = '\0';
|
oldpath[0] = '\0';
|
||||||
/* Reset filter */
|
/* Reset filter */
|
||||||
xstrlcpy(fltr, ifilter, LINE_MAX);
|
xstrlcpy(fltr, ifilter, LINE_MAX);
|
||||||
DPRINTF_S(path);
|
DPRINTF_S(path);
|
||||||
if (cfg.filtermode)
|
if (cfg.filtermode)
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
dstdir = NULL;
|
|
||||||
goto begin;
|
goto begin;
|
||||||
case SEL_CDLAST: // fallthrough
|
case SEL_CDLAST: // fallthrough
|
||||||
case SEL_VISIT:
|
case SEL_VISIT:
|
||||||
|
|
Loading…
Reference in a new issue