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:08:25 -07:00
parent 9028104536
commit cddc4cfb1d
5 changed files with 29 additions and 29 deletions

View File

@@ -544,7 +544,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 {