Merge branch 'master' into gfio
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 92501338d456fde659af69beb8066ce239f39a8a..a701a5bb67b78dbdaa05dd827c776c9dd73ff34f 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -139,6 +139,19 @@ static unsigned long get_mult_time(char c)
        }
 }
 
+static int is_separator(char c)
+{
+       switch (c) {
+       case ':':
+       case '-':
+       case ',':
+       case '/':
+               return 1;
+       default:
+               return 0;
+       }
+}
+
 static unsigned long long __get_mult_bytes(const char *p, void *data,
                                           int *percent)
 {
@@ -152,8 +165,13 @@ static unsigned long long __get_mult_bytes(const char *p, void *data,
 
        c = strdup(p);
 
-       for (i = 0; i < strlen(c); i++)
+       for (i = 0; i < strlen(c); i++) {
                c[i] = tolower(c[i]);
+               if (is_separator(c[i])) {
+                       c[i] = '\0';
+                       break;
+               }
+       }
 
        if (!strncmp("pib", c, 3)) {
                pow = 5;