author | Thomas Rast <trast@student.ethz.ch> | |
Sun, 17 Oct 2010 19:23:21 +0000 (21:23 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 18 Oct 2010 23:10:55 +0000 (16:10 -0700) | ||
commit | 9e5f5d4cfea5bb7706f1f8bb07795d52d37a59fe | |
tree | 9b82c97bec2fd89fd64449af23589cd5a2b7cead | tree | snapshot |
parent | 352953a556e7f8d720e26a32d4aabbf823d3c4d4 | commit | diff |
prefix_filename(): safely handle the case where pfx_len=0
Current prefix_filename() is proofed against the case where the prefix
'pfx' is NULL or a 0-length string, _except on Windows_.
Change the behaviour to work the same on both platforms, and only
check pfx_len so that callers passing a NULL prefix with a nonzero
pfx_len segfault early on both.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Current prefix_filename() is proofed against the case where the prefix
'pfx' is NULL or a 0-length string, _except on Windows_.
Change the behaviour to work the same on both platforms, and only
check pfx_len so that callers passing a NULL prefix with a nonzero
pfx_len segfault early on both.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c | diff | blob | history |