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

« back to all changes in this revision

Viewing changes to Python/pystrtod.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 00:02:12 UTC
  • mfrom: (39022.1.34 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922000212-7r0q4f4ugiq57jph
Merged in changes from the Atomic Grouping / Possessive Qualifiers 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