projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfdcb55
)
stripspace: incomplete line fix (take #2)
author
Junio C Hamano
<junkio@cox.net>
Fri, 14 Apr 2006 19:41:51 +0000
(12:41 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Fri, 14 Apr 2006 19:41:51 +0000
(12:41 -0700)
This fixes
f4ee3eb68906f079dea45de4f1bbb03d68189eb3
breakage, which
added an extra trailing blank line after stripping trailing blank lines
by mistake.
Signed-off-by: Junio C Hamano <junkio@cox.net>
stripspace.c
patch
|
blob
|
history
diff --git
a/stripspace.c
b/stripspace.c
index dee1ef06edae928c6103fea6b21812de22140a6e..65a6346452bb924d203724a9bfeb1c4ed98025e1 100644
(file)
--- a/
stripspace.c
+++ b/
stripspace.c
@@
-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))