From dbb07bc3f5a8ac8b76030ec16fc3757eb002760d Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Wed, 16 Aug 2017 13:19:17 -0700 Subject: [PATCH] fix `set --show` of semi-empty var A semi-empty var is one with a single empty string element. The `env_var_t::empty()` method returns true for such vars but we want `set --show` to report that it has a single empty element. --- src/builtin_set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 97bb4ba52..06140b95c 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -330,7 +330,7 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams const env_var_t var = env_get_string(var_name, scope | ENV_USER); wcstring_list_t result; - if (!var.empty()) tokenize_variable_array(var, result); + tokenize_variable_array(var, result); streams.out.append_format(_(L"$%ls: set in %ls scope, %ls, with %d elements\n"), var_name, scope_name, exportv, result.size());