Commit 2564aa4
blame.c: Properly initialize strbuf after calling, textconv_object()
For a plain string where only the length is known, strbuf.alloc needs to
be initialized to the length. Otherwise strbuf.alloc is 0 and a later
call to strbuf_setlen() will fail.
This bug surfaced when calling git blame under Windows on a *.doc file.
The *.doc file is converted to plain text by antiword via the textconv
mechanism. However, the plain text returned by antiword contains DOS line
endings instead of Unix line endings which triggered the strbuf_setlen()
which previous to this patch failed.
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 9006471 commit 2564aa4
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2094 | 2094 | | |
2095 | 2095 | | |
2096 | 2096 | | |
2097 | | - | |
| 2097 | + | |
| 2098 | + | |
2098 | 2099 | | |
| 2100 | + | |
2099 | 2101 | | |
2100 | 2102 | | |
2101 | 2103 | | |
| |||
0 commit comments