]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #639: store NNNLVL in tmp var
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 6 Jun 2020 19:04:46 +0000 (00:34 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 6 Jun 2020 19:05:05 +0000 (00:35 +0530)
src/nnn.c

index e822a4c2eab1cf9fce8fe3630ed54de47e3ff25e..e2b02b2747b855b0e6e221ce423b3fb82e2b58be 100644 (file)
--- 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: