From: Arun Prakash Jana <engineerarun@gmail.com> Date: Wed, 7 Aug 2019 20:09:41 +0000 (+0530) Subject: Fix #315: crash is NNN_BMS is not set X-Git-Tag: v2.7~162 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=8ca96422cd92cdce1f2cf943457b2a42bb02408b;p=nnn.git Fix #315: crash is NNN_BMS is not set --- diff --git a/src/nnn.c b/src/nnn.c index 62c78c0c..c3997911 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -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;