From 853ee7fc686293cd45fbb177c75114ed2489144d Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 6 Mar 2009 20:29:29 +0100 Subject: [PATCH] Fix failure to strip end of line with comment We left a space at the end, which confused the postfix checking. Signed-off-by: Jens Axboe --- parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index f838a1f6..d653f5e4 100644 --- a/parse.c +++ b/parse.c @@ -152,7 +152,7 @@ void strip_blank_front(char **p) void strip_blank_end(char *p) { - char *s; + char *start = p, *s; s = strchr(p, ';'); if (s) @@ -164,7 +164,7 @@ void strip_blank_end(char *p) p = s; s = p + strlen(p); - while ((isspace(*s) || iscntrl(*s)) && (s > p)) + while ((isspace(*s) || iscntrl(*s)) && (s > start)) s--; *(s + 1) = '\0'; -- 2.25.1