mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
checkpatch fix: refactor run script code
This commit is contained in:
parent
5402e1201c
commit
59a5db2c90
20
src/nnn.c
20
src/nnn.c
|
@ -3851,7 +3851,18 @@ nochange:
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
/* Regular script file */
|
||||||
|
if (S_ISREG(sb.st_mode)) {
|
||||||
|
tmp = ndents ? dents[cur].name : NULL;
|
||||||
|
spawn(shell, scriptpath, tmp, path, F_NORMAL | F_SIGINT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Must be a directory or a regular file */
|
||||||
|
if (!S_ISDIR(sb.st_mode))
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Script directory */
|
||||||
cfg.runscript ^= 1;
|
cfg.runscript ^= 1;
|
||||||
if (!cfg.runscript && rundir[0]) {
|
if (!cfg.runscript && rundir[0]) {
|
||||||
/*
|
/*
|
||||||
|
@ -3880,13 +3891,6 @@ nochange:
|
||||||
lastname[0] = '\0';
|
lastname[0] = '\0';
|
||||||
setdirwatch();
|
setdirwatch();
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
|
||||||
|
|
||||||
if (S_ISREG(sb.st_mode)) {
|
|
||||||
tmp = ndents ? dents[cur].name : NULL;
|
|
||||||
spawn(shell, scriptpath, tmp, path, F_NORMAL | F_SIGINT);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: /* SEL_RUNCMD */
|
default: /* SEL_RUNCMD */
|
||||||
#ifndef NORL
|
#ifndef NORL
|
||||||
if (cfg.picker) {
|
if (cfg.picker) {
|
||||||
|
|
Loading…
Reference in a new issue