quoted
quoted
quoted
quoted
"LT" == Linus Torvalds [off-list ref] writes:
LT> How about instead making sure that any "extra" text be NUL-terminated and
LT> never start with ':' after a NUL (which will automatically be true, since
LT> it's either "diff-tree " + ascii for the verbose case, or just the tree
LT> name).
Makes much more sense although it has certain amount of Yuck
factor ;-).
On Mon, 23 May 2005, Junio C Hamano wrote:
LT> How about instead making sure that any "extra" text be NUL-terminated and
LT> never start with ':' after a NUL (which will automatically be true, since
LT> it's either "diff-tree " + ascii for the verbose case, or just the tree
LT> name).
Makes much more sense although it has certain amount of Yuck
factor ;-).
Actually, your solution is the yucky one.
You didn't realize that your whole DIFF_FORMAT_MACHINE case really can be
written as just
printf("%s%c", header, 0);
ie you print the header as _one_ long line, instead of splitting it up
into many. It's still a perfectly valid line, and perfectly unrecognizable
as such.
Now, maybe diff-helper is unhappy about such long lines, but that should
be solvable..
Linus