diff Python/pystrtod.c @ 48537:48e83e66935a

Merged revisions 65125 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r65125 | eric.smith | 2008-07-18 20:24:05 -0400 (Fri, 18 Jul 2008) | 1 line Fix issue 3411: default float format spec fails on negative numbers. ........
author Eric Smith <eric@trueblade.com>
date Sat, 19 Jul 2008 00:33:23 +0000
parents 098173e844d1
children 021c39a37edf 28096ed73153
line wrap: on
line diff
--- a/Python/pystrtod.c	Fri Jul 18 21:09:40 2008 +0000
+++ b/Python/pystrtod.c	Sat Jul 19 00:33:23 2008 +0000
@@ -302,6 +302,10 @@
 
 	/* search for the first non-digit character */
 	char *p = buffer;
+	if (*p == '-' || *p == '+')
+		/* Skip leading sign, if present.  I think this could only
+		   ever be '-', but it can't hurt to check for both. */
+		++p;
 	while (*p && isdigit(Py_CHARMASK(*p)))
 		++p;