Only do the root warning once per thread
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index ace34a697d20af4ffcff9fd013898927f3dd550c..f0e644f113bf63171fbebc8e0bd2545ae5d0fcd8 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -148,9 +148,19 @@ void strip_blank_front(char **p)
 
 void strip_blank_end(char *p)
 {
-       char *s = p + strlen(p) - 1;
-
-       while (isspace(*s) || iscntrl(*s))
+       char *s;
+
+       s = strchr(p, ';');
+       if (s)
+               *s = '\0';
+       s = strchr(p, '#');
+       if (s)
+               *s = '\0';
+       if (s)
+               p = s;
+
+       s = p + strlen(p);
+       while ((isspace(*s) || iscntrl(*s)) && (s > p))
                s--;
 
        *(s + 1) = '\0';