Fix #315: crash is NNN_BMS is not set

This commit is contained in:
Arun Prakash Jana 2019-08-08 01:39:41 +05:30
parent 93f2822f7c
commit 8ca96422cd
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 6 additions and 3 deletions

View File

@ -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;