author | Junio C Hamano <gitster@pobox.com> | |
Fri, 22 Jan 2010 22:17:06 +0000 (14:17 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 22 Jan 2010 22:31:30 +0000 (14:31 -0800) | ||
commit | af82559b435aa2a18f38a4f47a93729c8dc543d3 | |
tree | 1b778e52a005cdd96b3f59c6439c88a9ec83e0f8 | tree | snapshot |
parent | 30c9e919b6ef33b0427a3ad784ed9e951ea48648 | commit | diff |
git-mv: fix moving more than one source to a single destination
The code used as if return value from basename(3) were stable, but
often the function is implemented to return a pointer to a static
storage internal to it.
Because basename(3) is also allowed to modify its input parameter in
place, casting constness away from the strings we obtained from the
caller and giving them to basename is a no-no.
Reported, and initial fix and test supplied by David Rydh.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The code used as if return value from basename(3) were stable, but
often the function is implemented to return a pointer to a static
storage internal to it.
Because basename(3) is also allowed to modify its input parameter in
place, casting constness away from the strings we obtained from the
caller and giving them to basename is a no-no.
Reported, and initial fix and test supplied by David Rydh.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-mv.c | diff | blob | history | |
t/t7001-mv.sh | diff | blob | history |