diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-01-19 10:07:04 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-01-19 10:07:04 +0530 |
commit | 91a31dc61df6868e6b1cd5d4f69cc3b78377cf4b (patch) | |
tree | bac2c71162fb2b205d9ddf5d03893c1478ff7681 /src/nnn.c | |
parent | 867266431f90c2b989c45a5a62fc35bf9f5efbcf (diff) | |
download | nnn-91a31dc61df6868e6b1cd5d4f69cc3b78377cf4b.tar.gz |
Use a more sensible var name
Diffstat (limited to 'src/nnn.c')
-rw-r--r-- | src/nnn.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -302,7 +302,7 @@ static char *copier; static char *editor; static char *pager, *pager_arg; static char *shell, *shell_arg; -static char *runpath; +static char *scriptpath; static blkcnt_t ent_blocks; static blkcnt_t dir_blocks; static ulong num_files; @@ -2164,8 +2164,8 @@ static bool show_help(char *path) dprintf(fd, "NNN_COPIER: %s\n", copier); else if (g_cppath[0]) dprintf(fd, "copy file: %s\n", g_cppath); - if (runpath) - dprintf(fd, "NNN_SCRIPT: %s\n", runpath); + if (scriptpath) + dprintf(fd, "NNN_SCRIPT: %s\n", scriptpath); if (getenv("NNN_SHOW_HIDDEN")) dprintf(fd, "NNN_SHOW_HIDDEN: 1\n"); if (cfg.autoselect) @@ -2757,7 +2757,7 @@ nochange: continue; /* Must be in script directory to select script */ - if (strcmp(path, runpath) != 0) + if (strcmp(path, scriptpath) != 0) continue; mkpath(path, dents[cur].name, newpath, PATH_MAX); @@ -3457,12 +3457,12 @@ nochange: spawn(shell, shell_arg, NULL, path, F_NORMAL | F_MARKER); break; case SEL_SCRIPT: - if (!runpath) { + if (!scriptpath) { printmsg("set NNN_SCRIPT"); goto nochange; } - if (stat(runpath, &sb) == -1) { + if (stat(scriptpath, &sb) == -1) { printwarn(); goto nochange; } @@ -3472,7 +3472,7 @@ nochange: if (!cfg.runscript && rundir[0]) { /* If toggled, and still in the script dir, switch to original directory */ - if (strcmp(path, runpath) == 0) { + if (strcmp(path, scriptpath) == 0) { xstrlcpy(path, rundir, PATH_MAX); xstrlcpy(lastname, runfile, NAME_MAX); rundir[0] = runfile[0] = '\0'; @@ -3483,11 +3483,11 @@ nochange: } /* Check if directory is accessible */ - if (!xdiraccess(runpath)) + if (!xdiraccess(scriptpath)) goto nochange; xstrlcpy(rundir, path, PATH_MAX); - xstrlcpy(path, runpath, PATH_MAX); + xstrlcpy(path, scriptpath, PATH_MAX); if (ndents) xstrlcpy(runfile, dents[cur].name, NAME_MAX); cfg.runctx = cfg.curctx; @@ -3501,7 +3501,7 @@ nochange: tmp = dents[cur].name; else tmp = NULL; - spawn(shell, runpath, tmp, path, F_NORMAL | F_SIGINT); + spawn(shell, scriptpath, tmp, path, F_NORMAL | F_SIGINT); } break; default: /* SEL_RUNCMD */ @@ -3744,7 +3744,7 @@ int main(int argc, char *argv[]) getprogarg(shell, &shell_arg); /* Setup script execution */ - runpath = getenv("NNN_SCRIPT"); + scriptpath = getenv("NNN_SCRIPT"); #ifdef LINUX_INOTIFY /* Initialize inotify */ |