mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 13:34:40 +08:00
Remove unused 'end' variable from SHLVL calculation
This commit is contained in:
parent
7ff0e7d0f7
commit
5c216e3d8c
@ -376,10 +376,9 @@ void env_init(const struct config_paths_t *paths, bool do_uvars, bool default_pa
|
||||
if (is_interactive_session()) {
|
||||
wcstring nshlvl_str = L"1";
|
||||
if (const char *shlvl_var = getenv("SHLVL")) {
|
||||
const wchar_t *end;
|
||||
// TODO: Figure out how to handle invalid numbers better. Shouldn't we issue a
|
||||
// diagnostic?
|
||||
long shlvl_i = fish_wcstol(str2wcstring(shlvl_var).c_str(), &end);
|
||||
long shlvl_i = fish_wcstol(str2wcstring(shlvl_var).c_str());
|
||||
if (!errno && shlvl_i >= 0) {
|
||||
nshlvl_str = to_string(shlvl_i + 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user