From ff09b8c1ee72b9e48fa8c3bfec0c3195fb9ea7e4 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Fri, 4 Aug 2017 17:13:43 -0700 Subject: [PATCH] fix `set --show` output I realized I was printing individual var entries using zero based indexing (like C++) when the indexes should be one based. --- 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 843218f2c..17ba49ade 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -342,7 +342,7 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams const wcstring value = result[i]; const wcstring escaped_val = escape_string(value.c_str(), ESCAPE_NO_QUOTED, STRING_STYLE_SCRIPT); - streams.out.append_format(_(L"$%ls[%d]: length=%d value=|%ls|\n"), var_name, i, + streams.out.append_format(_(L"$%ls[%d]: length=%d value=|%ls|\n"), var_name, i + 1, value.size(), escaped_val.c_str()); } } else {