зеркало из https://github.com/microsoft/git.git
stripspace: incomplete line fix (take #2)
This fixes f4ee3eb689
breakage, which
added an extra trailing blank line after stripping trailing blank lines
by mistake.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Родитель
dfdcb558ec
Коммит
5cf7e21fbc
|
@ -12,7 +12,9 @@ static int cleanup(char *line)
|
|||
{
|
||||
int len = strlen(line);
|
||||
|
||||
if (len > 1 && line[len-1] == '\n') {
|
||||
if (len && line[len-1] == '\n') {
|
||||
if (len == 1)
|
||||
return 0;
|
||||
do {
|
||||
unsigned char c = line[len-2];
|
||||
if (!isspace(c))
|
||||
|
|
Загрузка…
Ссылка в новой задаче