Commit 8696da34 by Richard Stallman

(readescape): For \x, don't include leading 0's in count.

From-SVN: r1973
parent e64bddee
...@@ -803,6 +803,7 @@ readescape () ...@@ -803,6 +803,7 @@ readescape ()
register int code; register int code;
register unsigned count; register unsigned count;
unsigned firstdig; unsigned firstdig;
int nonnull;
switch (c) switch (c)
{ {
...@@ -815,6 +816,7 @@ readescape () ...@@ -815,6 +816,7 @@ readescape ()
code = 0; code = 0;
count = 0; count = 0;
nonnull = 0;
while (1) while (1)
{ {
c = getc (finput); c = getc (finput);
...@@ -832,11 +834,15 @@ readescape () ...@@ -832,11 +834,15 @@ readescape ()
code += c - 'A' + 10; code += c - 'A' + 10;
if (c >= '0' && c <= '9') if (c >= '0' && c <= '9')
code += c - '0'; code += c - '0';
if (code != 0 || count != 0)
{
if (count == 0) if (count == 0)
firstdig = code; firstdig = code;
count++; count++;
} }
if (count == 0) nonnull = 1;
}
if (! nonnull)
error ("\\x used with no following hex digits"); error ("\\x used with no following hex digits");
else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node) else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node)
|| (count > 1 || (count > 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment