aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-10-24 18:54:33 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-10-24 20:25:07 +0530
commitb987931f47a0e062fe85b46052910af2d3c21488 (patch)
treeeeb6097775a77461ba55f11699d69d0e4f540427 /src
parent8c096dad28915c0ba6fdc5eb5a3425381156ded2 (diff)
downloadnnn-b987931f47a0e062fe85b46052910af2d3c21488.tar.gz
Do not pass path to commands
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nnn.c b/src/nnn.c
index c5a59c7..0a577ff 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -120,8 +120,7 @@
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define ISODD(x) ((x) & 1)
#define ISBLANK(x) ((x) == ' ' || (x) == '\t')
-#define TOUPPER(ch) \
- (((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch))
+#define TOUPPER(ch) (((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch))
#define CMD_LEN_MAX (PATH_MAX + ((NAME_MAX + 1) << 1))
#define READLINE_MAX 128
#define FILTER '/'
@@ -345,6 +344,7 @@ static char g_tmpfpath[TMP_LEN_MAX] __attribute__ ((aligned));
/* Buffer to store plugins control pipe location */
static char g_pipepath[TMP_LEN_MAX] __attribute__ ((aligned));
+/* Plugin control initialization status */
static bool g_plinit = FALSE;
/* Replace-str for xargs on different platforms */
@@ -3798,14 +3798,12 @@ static void redraw(char *path)
xcols = COLS;
int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX;
- int lastln = xlines, onscreen = xlines - 4;
+ int lastln = xlines - 1, onscreen = xlines - 4;
int i, attrs;
char buf[24];
char c;
char *ptr = path, *base;
- --lastln;
-
/* Clear screen */
erase();
@@ -3840,7 +3838,6 @@ static void redraw(char *path)
addch(' ');
}
}
-
addstr("\b] "); /* 10 chars printed for contexts - "[1 2 3 4] " */
attron(A_UNDERLINE);
@@ -4951,11 +4948,14 @@ nochange:
if (tmp[0] == '_' && tmp[1]) {
xstrlcpy(newpath, ++tmp, PATH_MAX);
flag = F_CLI | F_CONFIRM;
- } else
+ tmp = NULL;
+ } else {
mkpath(plugindir, tmp, newpath);
+ tmp = path;
+ }
spawn(newpath, (ndents ? dents[cur].name : NULL),
- path, path, flag);
+ tmp, path, flag);
if (cfg.filtermode)
presel = FILTER;