~pythonregexp2.7/python/issue2636-09-01+10

« back to all changes in this revision

Viewing changes to Python/pystrtod.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 21:39:45 UTC
  • mfrom: (39055.1.33 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922213945-23717m5eiqpamcyn
Merged in changes from the Single-Loop Engine branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
302
302
 
303
303
        /* search for the first non-digit character */
304
304
        char *p = buffer;
 
305
        if (*p == '-' || *p == '+')
 
306
                /* Skip leading sign, if present.  I think this could only
 
307
                   ever be '-', but it can't hurt to check for both. */
 
308
                ++p;
305
309
        while (*p && isdigit(Py_CHARMASK(*p)))
306
310
                ++p;
307
311
 
364
368
        /* At this point, p points just past the right-most character we
365
369
           want to format.  We need to add the grouping string for the
366
370
           characters between buffer and p. */
367
 
        return _PyString_InsertThousandsGrouping(buffer, len, p,
 
371
        return _PyString_InsertThousandsGrouping(buffer, len, p-buffer,
368
372
                                                 buf_size, NULL, 1);
369
373
}
370
374