ref: dd81f42282914bd7820a402e8e7e08431c9e9992
parent: 07373c8de942348a9cba74b85b6acb59c5fea566
author: Just van Rossum <[email protected]>
date: Tue Aug 1 16:47:48 EDT 2000
fixed t1_tofixed() to handle floats of the form .001 and -.001 correctly.
--- a/src/type1z/z1parse.c
+++ b/src/type1z/z1parse.c
@@ -504,16 +504,21 @@
if ( cur >= limit )
return 0;
- /* first of all, read the integer part */
- result = t1_toint( &cur, limit ) << 16;
- num = 0;
- divider = 1;
-
- if ( result < 0 )
+ /* first of all, check the sign */
+ if ( *cur == '-' )
{
- sign = 1;
- result = -result;
+ sign = 1;
+ cur++;
}
+
+ /* then, read the integer part, if any */
+ if ( *cur != '.' )
+ result = t1_toint( &cur, limit ) << 16;
+ else
+ result = 0;
+
+ num = 0;
+ divider = 1;
if ( cur >= limit )
goto Exit;