diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-08-08 01:39:41 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-08-08 01:39:41 +0530 |
commit | 8ca96422cd92cdce1f2cf943457b2a42bb02408b (patch) | |
tree | 652731abec2a14b32813bb9584cb2ca7925a1e2b | |
parent | 93f2822f7c4375dc2772f3fbd94b9a1bc192f87d (diff) | |
download | nnn-8ca96422cd92cdce1f2cf943457b2a42bb02408b.tar.gz |
Fix #315: crash is NNN_BMS is not set
-rw-r--r-- | src/nnn.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2074,13 +2074,16 @@ static int xlink(char *suffix, char *path, char *buf, int *presel, int type) static bool parsebmstr(void) { int i = 0; - bmstr = strdup(getenv(env_cfg[NNN_BMS])); - char *bms = bmstr; - char *nextkey = bms; + char *nextkey; + char *bms = getenv(env_cfg[NNN_BMS]); if (!bms || !*bms) return TRUE; + bmstr = strdup(bms); + bms = bmstr; + nextkey = bms; + while (*bms && i < BM_MAX) { if (bms == nextkey) { bookmark[i].key = *bms; |