number_parse doesn't expect leading sign, so handle it explicitly.
Signed-off-by: NeilBrown <neil@brown.name>
static int parse_value(struct value *vl, char *arg)
{
struct text tx;
+ int neg = 0;
switch(vl->vtype) {
case Vunknown:
case Vnone:
memcpy(vl->str.txt, arg, vl->str.len);
break;
case Vnum:
+ if (*arg == '-') {
+ neg = 1;
+ arg++;
+ }
tx.txt = arg; tx.len = strlen(tx.txt);
if (number_parse(vl->num, vl->tail, tx) == 0)
mpq_init(vl->num);
+ else if (neg)
+ mpq_neg(vl->num, vl->num);
break;
case Vbool:
if (strcasecmp(arg, "true") == 0 ||