aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-08-07 18:46:47 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-08-07 18:46:47 +0530
commit26e18ab382ef388a8d3475464a03ed3ba37a68dc (patch)
tree48b106495e7241d4630d0746032dc8c3e6c2783b /src/nnn.c
parent8c2c7e9e9753351082979b78c91e7fa7f75893c8 (diff)
downloadnnn-26e18ab382ef388a8d3475464a03ed3ba37a68dc.tar.gz
Fix #315
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 7aa7c38..f41558b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -278,6 +278,7 @@ static int ndents, cur, curscroll, total_dents = ENTRY_INCR;
static int xlines, xcols;
static uint idle;
static uint idletimeout, copybufpos, copybuflen;
+static char *bmstr;
static char *opener;
static char *copier;
static char *editor;
@@ -2073,7 +2074,8 @@ static int xlink(char *suffix, char *path, char *buf, int *presel, int type)
static bool parsebmstr(void)
{
int i = 0;
- char *bms = getenv(env_cfg[NNN_BMS]);
+ bmstr = strdup(getenv(env_cfg[NNN_BMS]));
+ char *bms = bmstr;
char *nextkey = bms;
if (!bms || !*bms)
@@ -4619,6 +4621,7 @@ static void cleanup(void)
free(plugindir);
free(cfgdir);
free(initpath);
+ free(bmstr);
#ifdef DBGMODE
disabledbg();