if (*val == LONG_MAX && errno == ERANGE)
return 1;
- if (kilo)
- *val *= get_mult_bytes(str[len - 1], data);
- else
+ if (kilo) {
+ const char *p;
+ /*
+ * if the last char is 'b' or 'B', the user likely used
+ * "1gb" instead of just "1g". If the second to last is also
+ * a letter, adjust.
+ */
+ p = str + len - 1;
+ if ((*p == 'b' || *p == 'B') && isalpha(*(p - 1)))
+ --p;
+
+ *val *= get_mult_bytes(*p, data);
+ } else
*val *= get_mult_time(str[len - 1]);
return 0;
o1 = get_option(s1, fio_options, &foo);
o2 = get_option(s2, fio_options, &foo);
-
+
prio1 = prio2 = 0;
if (o1)
prio1 = o1->prio;