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.
This commit is contained in:
Kurtis Rader 2017-08-04 17:13:43 -07:00
parent 2b2057a56b
commit ff09b8c1ee

View File

@ -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 {