Revert "Fix parser bug with ranges"
This reverts commit f20485ad77872d6c5084dead547420386a6ecd5e.
diff --git a/options.c b/options.c
index 06ac659..74c24d0 100644
--- a/options.c
+++ b/options.c
@@ -102,7 +102,7 @@
} else
perc = -1;
- if (str_to_decimal(fname, &val, 1, 1, td)) {
+ if (str_to_decimal(fname, &val, 1, td)) {
log_err("fio: bssplit conversion failed\n");
free(td->o.bssplit);
return 1;
@@ -213,7 +213,7 @@
else {
long long val;
- if (str_to_decimal(nr, &val, 1, 0, td)) {
+ if (str_to_decimal(nr, &val, 1, td)) {
log_err("fio: rw postfix parsing failed\n");
free(nr);
return 1;
diff --git a/parse.c b/parse.c
index 55de4f0..2dee446 100644
--- a/parse.c
+++ b/parse.c
@@ -184,7 +184,7 @@
}
static unsigned long long get_mult_bytes(const char *str, int len, void *data,
- int *percent, int is_range)
+ int *percent)
{
const char *p = str;
@@ -195,9 +195,7 @@
* Go forward until we hit a non-digit, or +/- sign
*/
while ((p - str) <= len) {
- if (!isdigit((int) *p) && (*p != '+'))
- break;
- if (!is_range && (*p != '-'))
+ if (!isdigit((int) *p) && (*p != '+') && (*p != '-'))
break;
p++;
}
@@ -219,7 +217,7 @@
/*
* convert string into decimal value, noting any size suffix
*/
-int str_to_decimal(const char *str, long long *val, int kilo, int is_range, void *data)
+int str_to_decimal(const char *str, long long *val, int kilo, void *data)
{
int len, base;
@@ -240,7 +238,7 @@
unsigned long long mult;
int perc = 0;
- mult = get_mult_bytes(str, len, data, &perc, is_range);
+ mult = get_mult_bytes(str, len, data, &perc);
if (perc)
*val = -1ULL - *val;
else
@@ -251,14 +249,14 @@
return 0;
}
-static int check_str_bytes(const char *p, long long *val, int is_range, void *data)
+static int check_str_bytes(const char *p, long long *val, void *data)
{
- return str_to_decimal(p, val, 1, is_range, data);
+ return str_to_decimal(p, val, 1, data);
}
static int check_str_time(const char *p, long long *val)
{
- return str_to_decimal(p, val, 0, 0, NULL);
+ return str_to_decimal(p, val, 0, NULL);
}
void strip_blank_front(char **p)
@@ -295,7 +293,7 @@
{
long long __val;
- if (!str_to_decimal(str, &__val, 1, 1, data)) {
+ if (!str_to_decimal(str, &__val, 1, data)) {
*val = __val;
return 0;
}
@@ -404,7 +402,7 @@
if (is_time)
ret = check_str_time(ptr, &ull);
else
- ret = check_str_bytes(ptr, &ull, 0, data);
+ ret = check_str_bytes(ptr, &ull, data);
if (ret)
break;
diff --git a/parse.h b/parse.h
index f1f3927..f2265a4 100644
--- a/parse.h
+++ b/parse.h
@@ -75,7 +75,7 @@
extern void strip_blank_front(char **);
extern void strip_blank_end(char *);
-extern int str_to_decimal(const char *, long long *, int, int, void *);
+extern int str_to_decimal(const char *, long long *, int, void *);
/*
* Handlers for the options