commit | 523bfadbd46b375012eb5f3898201455b057a1c4 | [log] [tgz] |
---|---|---|
author | Jens Axboe <jens.axboe@oracle.com> | Wed Apr 04 11:04:06 2007 +0200 |
committer | Jens Axboe <jens.axboe@oracle.com> | Wed Apr 04 11:04:06 2007 +0200 |
tree | 99b7425e92e4a308d2f4c3cf046e6a808c62389b | |
parent | e11c410cbd60400c10d92d0115880c6e5728aa4e [diff] [blame] |
Have strip_blank_end() also strip off any comments Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c index ace34a6..9015b1d 100644 --- a/parse.c +++ b/parse.c
@@ -148,8 +148,18 @@ 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--;