about summary refs log tree commit diff
path: root/stdio-common/vfscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/vfscanf.c')
-rw-r--r--stdio-common/vfscanf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 14aa7d9748..c13627aac2 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -703,6 +703,11 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
 	  else
 	    not_in = 0;
 
+	  if (*f == ']')
+	    /* If ] appears before any char in the set, it is not
+	       the terminator, but the first char in the set.  */
+	    ADDW (*f++);
+
 	  while ((fc = *f++) != '\0' && fc != ']')
 	    {
 	      if (fc == '-' && *f != '\0' && *f != ']' &&