]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Clarify that scanf does not use character classes. Fixes bug 12986
authorOndřej Bílka <neleai@seznam.cz>
Mon, 23 Dec 2013 16:44:47 +0000 (17:44 +0100)
committerOndřej Bílka <neleai@seznam.cz>
Mon, 23 Dec 2013 16:54:39 +0000 (17:54 +0100)
Update documentation to say that scanf ("%[[:alpha:]]", c) does not read
alphabetic characters but is parsed literarily.

manual/stdio.texi

index 30630caf6b2c1dacfd23055858ad05f26d1a523f..7dcacd8af4f8e56d954491d69c49f8fca058eb55 100644 (file)
@@ -3672,7 +3672,7 @@ of the width or precision by @code{MB_CUR_MAX}.
 To read in characters that belong to an arbitrary set of your choice,
 use the @samp{%[} conversion.  You specify the set between the @samp{[}
 character and a following @samp{]} character, using the same syntax used
-in regular expressions.  As special cases:
+in regular expressions for explicit sets of characters.  As special cases:
 
 @itemize @bullet
 @item
@@ -3692,6 +3692,10 @@ the characters listed.
 The @samp{%[} conversion does not skip over initial whitespace
 characters.
 
+Note that the @dfn{character class} syntax available in character sets
+that appear inside regular expressions (such as @samp{[:alpha:]}) is
+@emph{not} available in the @samp{%[} conversion.
+
 Here are some examples of @samp{%[} conversions and what they mean:
 
 @table @samp