Junio C Hamano <gitster@xxxxxxxxx> 于2021年6月1日周二 下午5:54写道: > > > Well, there seems to be no correction here. But is it true that memory > > like "\0abc" is considered empty? > > That sample has 'a' or 'b' or 'c' that are clearly not part of an > "empty" string and irrelevant. After all, a string " abc" is not > treated as empty in the original implementation, either. > In other words, we still need to look at each character of strbuf, instead of stopping at NUL. > You are treating a block of memory with e.g. " \000 " (SP NUL SP) as > an "empty line" just like you do for " " (SP SP SP), but I think we > should treat it more like " \001 " or " \007 ", i.e. not an empty > string at all. OK. I understand it now: " \001 " is It’s like a block of space, but it’s not truly "empty", "SP NUL SP" is same too, So the complete definition of "empty" here should be: All characters are SP which do not contain NUL or other characters. Thanks. -- ZheNing Hu