From: Jens Axboe Date: Wed, 4 Apr 2007 09:04:06 +0000 (+0200) Subject: Have strip_blank_end() also strip off any comments X-Git-Tag: fio-1.15.2~9 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=523bfadbd46b375012eb5f3898201455b057a1c4;hp=e11c410cbd60400c10d92d0115880c6e5728aa4e Have strip_blank_end() also strip off any comments Signed-off-by: Jens Axboe --- diff --git a/parse.c b/parse.c index ace34a69..9015b1d7 100644 --- a/parse.c +++ b/parse.c @@ -148,8 +148,18 @@ void strip_blank_front(char **p) void strip_blank_end(char *p) { - char *s = p + strlen(p) - 1; - + char *s; + + s = strchr(p, ';'); + if (s) + *s = '\0'; + s = strchr(p, '#'); + if (s) + *s = '\0'; + if (s) + p = s; + + s = p + strlen(p) - 1; while (isspace(*s) || iscntrl(*s)) s--;