summaryrefslogtreecommitdiff
path: root/stripspace.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-04-14 21:56:37 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-04-14 21:56:37 -0700
commit7bfd678d21e7a5c01c3ca10b5eb8c2ab144cec4a (patch)
tree54608f44ecdea53e5219b6c66b880b676cc1ab84 /stripspace.c
parentMerge branch 'jc/fix5500' into next (diff)
parentrev-list --bisect: limit list before bisecting. (diff)
downloadtgif-7bfd678d21e7a5c01c3ca10b5eb8c2ab144cec4a.tar.xz
Merge branch 'jc/bottomless' into next
* jc/bottomless: rev-list --bisect: limit list before bisecting. Clean up trailing whitespace when pretty-printing commits "git cmd -h" for shell scripts. git-log <diff-options> <paths> documentation Retire git-log.sh (take #4) stripspace: incomplete line fix (take #2)
Diffstat (limited to 'stripspace.c')
-rw-r--r--stripspace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stripspace.c b/stripspace.c
index dee1ef06ed..65a6346452 100644
--- 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))