X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=1255a2d0710b983ad0092e7cd18720034847c097;hb=e2870fb94cbd22affecdd16e8f75f75e78d1c18b;hp=41776ca7a9a7cd4009f2ec86bf264bb22bf11d42;hpb=05712b2457a44ee0f0020eced77db03c2aa419a1;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 41776ca..1255a2d 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -366,7 +366,7 @@ script (int prompt) goto next_command; } p[len] = '\0'; - pend = &p[len+2]; + pend = p[len+1] ? &p[len+2] : &p[len+1]; } else if (*p == '\'') { p++; len = strcspn (p, "'"); @@ -381,7 +381,7 @@ script (int prompt) goto next_command; } p[len] = '\0'; - pend = &p[len+2]; + pend = p[len+1] ? &p[len+2] : &p[len+1]; /* } else if (*p == '[') { int c = 1;