diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-10-28 17:50:54 +0100 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2012-10-29 02:52:41 -0400 |
commit | 02e8ca0e50abc15596db1fa93bda29bbd91007a7 (patch) | |
tree | 60bf7e4d6bf513859df7d8217f8d6bd086a96fad /t/t3700-add.sh | |
parent | Git 1.7.12.4 (diff) | |
download | tgif-02e8ca0e50abc15596db1fa93bda29bbd91007a7.tar.xz |
parse_dirstat_params(): use string_list to split comma-separated string
Use string_list_split_in_place() to split the comma-separated
parameters string. This simplifies the code and also fixes a bug: the
old code made calls like
memcmp(p, "lines", p_len)
which needn't work if p_len is different than the length of the
constant string (and could illegally access memory if p_len is larger
than the length of the constant string).
When p_len was less than the length of the constant string, the old
code would have allowed some abbreviations to be accepted (e.g., "cha"
for "changes") but this seems to have been a bug rather than a
feature, because (1) it is not documented; (2) no attempt was made to
handle ambiguous abbreviations, like "c" for "changes" vs
"cumulative".
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 't/t3700-add.sh')
0 files changed, 0 insertions, 0 deletions