about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-02-18 09:43:44 +0000
committerUlrich Drepper <drepper@redhat.com>2007-02-18 09:43:44 +0000
commitda50f0010773cd88b34ad8b08f88d5ffabe061df (patch)
tree183a9e9bb2298b38f5a3752b7087900e9522c3b8
parente9bb524634a8d9e348a971e91f4f44266a148fe3 (diff)
downloadglibc-da50f0010773cd88b34ad8b08f88d5ffabe061df.tar.gz
glibc-da50f0010773cd88b34ad8b08f88d5ffabe061df.tar.xz
glibc-da50f0010773cd88b34ad8b08f88d5ffabe061df.zip
..
	More simplifications of floating-point reader.
-rw-r--r--ChangeLog1
-rw-r--r--stdio-common/vfscanf.c57
2 files changed, 1 insertions, 57 deletions
diff --git a/ChangeLog b/ChangeLog
index d38601e871..fc077832aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
 
 	* stdio-common/vfscanf.c: Remove unused WIDTH handling.
+	More simplifications of floating-point reader.
 
 	* stdio-common/Makefile (tests): Add tst-swscanf.
 	* stdio-common/tst-sscanf.c: Make tests usable for swscanf
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index b7acd7993b..1149686d75 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -1597,63 +1597,6 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 	      if (__builtin_expect (width == 0 || inchar () == EOF, 0))
 		/* EOF is only an input error before we read any chars.  */
 		conv_error ();
-	      if (! ISDIGIT (c) && TOLOWER (c) != L_('i')
-		  && TOLOWER (c) != L_('n'))
-		{
-#ifdef COMPILE_WSCANF
-		  if (__builtin_expect (c != decimal, 0))
-		    {
-		      /* This is no valid number.  */
-		      ungetc (c, s);
-		      conv_error ();
-		    }
-#else
-		  /* Match against the decimal point.  At this point
-                     we are taking advantage of the fact that we can
-                     push more than one character back.  This is
-                     (almost) never necessary since the decimal point
-                     string hopefully never contains more than one
-                     byte.  */
-		  const char *cmpp = decimal;
-		  int avail = width > 0 ? width : INT_MAX;
-
-		  while ((unsigned char) *cmpp == c && avail-- > 0)
-		    if (*++cmpp == '\0')
-		      break;
-		    else
-		      {
-			if (inchar () == EOF)
-			  break;
-		      }
-
-		  if (__builtin_expect (*cmpp != '\0', 0))
-		    {
-		      /* This is no valid number.  */
-		      while (1)
-			{
-			  ungetc (c, s);
-			  if (cmpp == decimal)
-			    break;
-			  c = (unsigned char) *--cmpp;
-			}
-
-		      conv_error ();
-		    }
-		  else
-		    {
-                     /* Add all the characters.  */
-                     for (cmpp = decimal; *cmpp != '\0'; ++cmpp)
-                       ADDW ((unsigned char) *cmpp);
-                     if (width > 0)
-                       width = avail;
-                     got_dot = 1;
-
-		      c = inchar ();
-		    }
-		  if (width > 0)
-		    width = avail;
-#endif
-		}
 	      if (width > 0)
 		--width;
 	    }