author | Jeff King <peff@peff.net> | |
Thu, 7 Oct 2010 18:25:43 +0000 (14:25 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 14 Oct 2010 01:58:33 +0000 (18:58 -0700) | ||
commit | 9130ac9fe17831445690ebbb60f09b86f96516b3 | |
tree | 36e2c5204978d544b6277526e5a31157acb818c9 | tree | snapshot |
parent | 7c6eafa35af805578990e76b691ff7f1a25a3c57 | commit | diff |
rev-list: handle %x00 NUL in user format
The code paths for showing commits in "git log" and "git
rev-list --graph" correctly handle embedded NULs by looking
only at the resulting strbuf's length, and never treating it
as a C string. The code path for regular rev-list, however,
used printf("%s"), which resulted in truncated output. This
patch uses fwrite instead, like the --graph code path.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The code paths for showing commits in "git log" and "git
rev-list --graph" correctly handle embedded NULs by looking
only at the resulting strbuf's length, and never treating it
as a C string. The code path for regular rev-list, however,
used printf("%s"), which resulted in truncated output. This
patch uses fwrite instead, like the --graph code path.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-list.c | diff | blob | history | |
t/t4012-diff-binary.sh | diff | blob | history | |
t/t6006-rev-list-format.sh | diff | blob | history | |
t/test-lib.sh | diff | blob | history |