Fix build break

This commit is contained in:
Arun Prakash Jana 2019-02-10 11:15:38 +05:30
parent 695dd10f0f
commit fc7a21f6e1
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -2917,15 +2917,11 @@ static void browse(char *ipath)
lastname = g_ctx[0].c_name; /* last visited filename */ lastname = g_ctx[0].c_name; /* last visited filename */
g_ctx[0].c_cfg = cfg; /* current configuration */ g_ctx[0].c_cfg = cfg; /* current configuration */
if (cfg.filtermode) cfg.filtermode ? (presel = FILTER) : (presel = 0);
presel = FILTER;
else
presel = 0;
dents = xrealloc(dents, total_dents * sizeof(struct entry)); dents = xrealloc(dents, total_dents * sizeof(struct entry));
if (dents == NULL) if (dents == NULL)
errexit(); errexit();
DPRINTF_P(dents);
/* Allocate buffer to hold names */ /* Allocate buffer to hold names */
pnamebuf = (char *)xrealloc(pnamebuf, NAMEBUF_INCR); pnamebuf = (char *)xrealloc(pnamebuf, NAMEBUF_INCR);
@ -2933,7 +2929,6 @@ static void browse(char *ipath)
free(dents); free(dents);
errexit(); errexit();
} }
DPRINTF_P(pnamebuf);
begin: begin:
#ifdef LINUX_INOTIFY #ifdef LINUX_INOTIFY
@ -3067,11 +3062,9 @@ nochange:
/* Handle script selection mode */ /* Handle script selection mode */
if (cfg.runscript) { if (cfg.runscript) {
if (cfg.runctx != cfg.curctx) if ((cfg.runctx != cfg.curctx)
continue; /* Must be in script directory to select script */
|| (strcmp(path, scriptpath) != 0))
/* Must be in script directory to select script */
if (strcmp(path, scriptpath) != 0)
continue; continue;
mkpath(path, dents[cur].name, newpath); mkpath(path, dents[cur].name, newpath);
@ -3146,10 +3139,7 @@ nochange:
case SEL_VISIT: case SEL_VISIT:
switch (sel) { switch (sel) {
case SEL_CDHOME: case SEL_CDHOME:
if (home) home ? (dir = home) : (dir = path);
dir = home;
else
dir = path;
break; break;
case SEL_CDBEGIN: case SEL_CDBEGIN:
dir = ipath; dir = ipath;
@ -3577,10 +3567,7 @@ nochange:
printmsg("selection off"); printmsg("selection off");
goto nochange; goto nochange;
case SEL_COPYLIST: case SEL_COPYLIST:
if (copybufpos) copybufpos ? showcplist() : printmsg("none selected");
showcplist();
else
printmsg("none selected");
goto nochange; goto nochange;
case SEL_CP: case SEL_CP:
case SEL_MV: case SEL_MV:
@ -3888,10 +3875,12 @@ nochange:
} }
break; break;
default: /* SEL_RUNCMD */ default: /* SEL_RUNCMD */
if (cfg.picker) if (cfg.picker) {
/* readline prompt breaks the interface, use stock */
tmp = xreadline(NULL, "> "); tmp = xreadline(NULL, "> ");
else { if (tmp[0])
/* Use libreadline */ spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
} else {
exitcurses(); exitcurses();
/* Switch to current path for readline(3) */ /* Switch to current path for readline(3) */
@ -3908,12 +3897,9 @@ nochange:
} }
refresh(); refresh();
}
if (tmp && tmp[0]) { if (tmp && tmp[0]) {
spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT); spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
/* The ideal check is !cfg.picker */
if (tmp != g_buf) {
/* readline finishing touches */ /* readline finishing touches */
add_history(tmp); add_history(tmp);
free(tmp); free(tmp);