Have strip_blank_end() also strip off any comments
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index ace34a697d20af4ffcff9fd013898927f3dd550c..9015b1d72bd5a527ef36ed0db12646ce01fcc945 100644 (file)
--- 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--;