From: Arun Prakash Jana Date: Sat, 6 Jun 2020 19:04:46 +0000 (+0530) Subject: Fix #639: store NNNLVL in tmp var X-Git-Tag: v3.3~56 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fdfbac03869a0250bcee4b8e9c486490f270aa9c;p=nnn.git Fix #639: store NNNLVL in tmp var --- diff --git a/src/nnn.c b/src/nnn.c index e822a4c2..e2b02b27 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -6377,11 +6377,12 @@ nochange: case SEL_SHELL: /* Set nnn nesting level */ tmp = getenv(env_cfg[NNNLVL]); - setenv(env_cfg[NNNLVL], xitoa((tmp ? atoi(tmp) : 0) + 1), 1); + r = tmp ? atoi(tmp) : 0; + setenv(env_cfg[NNNLVL], xitoa(r + 1), 1); setenv(envs[ENV_NCUR], (ndents ? dents[cur].name : ""), 1); spawn(shell, NULL, NULL, F_CLI); - setenv(env_cfg[NNNLVL], xitoa(tmp ? atoi(tmp) : 0), 1); + setenv(env_cfg[NNNLVL], xitoa(r), 1); r = TRUE; break; case SEL_LAUNCH: