{
if (ndents)
mkpath(path, dents[cur].name, newpath);
+ r = TRUE;
switch (sel) {
case SEL_MEDIA:
case SEL_RUNEDIT:
if (!quote_run_sh_cmd(editor, dents[cur].name, path))
goto nochange;
- r = TRUE;
break;
case SEL_RUNPAGE:
- r = TRUE;
spawn(pager, pager_arg, dents[cur].name, path, F_NORMAL);
break;
case SEL_NOTE:
if (!quote_run_sh_cmd(editor, notepath, NULL))
goto nochange;
- r = TRUE;
break;
}
default: /* SEL_LOCK */
- r = TRUE;
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL | F_SIGINT);
break;
}
copystartid = cur;
ncp = 0;
printmsg("selection on");
- DPRINTF_S("selection on");
goto nochange;
}
} // fallthrough
case SEL_COPYALL:
if (sel == SEL_COPYALL) {
- if (!ndents) {
- printmsg("0 entries");
+ if (!ndents)
goto nochange;
- }
cfg.copymode = 0;
copybufpos = 0;
if (!cpsafe())
goto nochange;
- if (sel == SEL_CP) {
+ switch (sel) {
+ case SEL_CP:
snprintf(g_buf, CMD_LEN_MAX,
#ifdef __linux__
"xargs -0 -a %s -%c src %s src .",
"cat %s | xargs -0 -o -%c src cp -iRp src .",
g_cppath, REPLACE_STR);
#endif
- } else if (sel == SEL_MV) {
+ break;
+ case SEL_MV:
snprintf(g_buf, CMD_LEN_MAX,
#ifdef __linux__
"xargs -0 -a %s -%c src %s src .",
"cat %s | xargs -0 -o -%c src mv -i src .",
g_cppath, REPLACE_STR);
#endif
- } else { /* SEL_RMMUL */
+ break;
+ default: /* SEL_RMMUL */
snprintf(g_buf, CMD_LEN_MAX,
#ifdef __linux__
"xargs -0 -a %s rm -%cr",
"cat %s | xargs -0 -o rm -%cr",
#endif
g_cppath, confirm_force());
+ break;
}
spawn("sh", "-c", g_buf, path, F_NORMAL | F_SIGINT);
} // fallthrough
case SEL_QUITCTX:
if (sel == SEL_QUITCTX) {
- uint iter = 1;
-
r = cfg.curctx;
- while (iter < CTX_MAX) {
+ for (fd = 1; fd < CTX_MAX; ++fd) {
(r == CTX_MAX - 1) ? (r = 0) : ++r;
if (g_ctx[r].c_cfg.ctxactive) {
g_ctx[cfg.curctx].c_cfg.ctxactive = 0;
setdirwatch();
goto begin;
}
-
- ++iter;
}
}