aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-10-14 14:42:11 +0200
committerBjörn-Egil Dahlberg <[email protected]>2010-10-14 14:42:16 +0200
commit0cfaafd999d74a085d6f3e212e90985700040691 (patch)
tree69d406b6b2345555515e4cf413e50073ea7e5f34 /lib/erl_interface/src
parentb9e554258331b66af6f95e5230a4b385fa3fe754 (diff)
parent386050e35675d3e4336f48a19b8562f9a62c1624 (diff)
downloadotp-0cfaafd999d74a085d6f3e212e90985700040691.tar.gz
otp-0cfaafd999d74a085d6f3e212e90985700040691.tar.bz2
otp-0cfaafd999d74a085d6f3e212e90985700040691.zip
Merge branch 'sv/ei-number-parsing' into dev
* sv/ei-number-parsing: teach ei_x_format to handle unary - and + OTP-8891
Diffstat (limited to 'lib/erl_interface/src')
-rw-r--r--lib/erl_interface/src/misc/ei_format.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c
index 08235d0ebe..b35421d4b2 100644
--- a/lib/erl_interface/src/misc/ei_format.c
+++ b/lib/erl_interface/src/misc/ei_format.c
@@ -106,6 +106,8 @@ static int eiformat(const char** fmt, union arg** args, ei_x_buff* x)
default:
if (isdigit((int)*p))
res = pdigit(&p, x);
+ else if ((*p == '-' || *p == '+') && isdigit((int)*(p+1)))
+ res = pdigit(&p, x);
else if (islower((int)*p))
res = patom(&p, x);
else
@@ -149,6 +151,8 @@ static int pdigit(const char** fmt, ei_x_buff* x)
double d;
long l;
+ if (**fmt == '-' || **fmt == '+')
+ (*fmt)++;
for (;;) {
c = *(*fmt)++;
if (isdigit((int)c))