aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.cpp
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-08-22 18:05:28 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-08-29 12:22:35 -0700
commit130619d6b07c691b1f34c56120020adaff09c49a (patch)
treedfc1d1f700d9707cd17494edfdfef37e81bd544b /env.cpp
parent71ab40e53690cd89fcb013362404ef7578a5a6fe (diff)
Fix $SHLVL
Due to being read-only, SHLVL wasn't being incremented properly for recursive invocations of fish.
Diffstat (limited to 'env.cpp')
-rw-r--r--env.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/env.cpp b/env.cpp
index 91bc7ac8..353085b8 100644
--- a/env.cpp
+++ b/env.cpp
@@ -443,7 +443,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
L"LINES",
L"COLUMNS",
L"PWD",
- L"SHLVL",
+ //L"SHLVL", // will be inserted a bit lower down
L"FISH_VERSION",
};
for (size_t i=0; i < sizeof ro_keys / sizeof *ro_keys; i++)
@@ -549,6 +549,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
}
}
env_set(L"SHLVL", nshlvl_str.c_str(), ENV_GLOBAL | ENV_EXPORT);
+ env_read_only.insert(L"SHLVL");
/* Set up the HOME variable */
if (env_get_string(L"HOME").missing_or_empty())