about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2010-04-07 17:28:36 -0700
committerPetr Baudis <pasky@ucw.cz>2010-05-12 03:21:15 +0200
commitd75c76e1d74d3c6fe508738abd442aae0365d690 (patch)
treefb27ebff70ecc0905c3bf1c1c2a3706db2f54fb4
parent443a33d8042f4084d4d1f40a5b973a19bcae9a23 (diff)
downloadglibc-d75c76e1d74d3c6fe508738abd442aae0365d690.tar.gz
glibc-d75c76e1d74d3c6fe508738abd442aae0365d690.tar.xz
glibc-d75c76e1d74d3c6fe508738abd442aae0365d690.zip
getopt mistakenly allows '-;' as short option
(cherry picked from commit cf0b68196c837ad591f0e7fc0f8e8a0f690b847c)
-rw-r--r--ChangeLog8
-rw-r--r--posix/getopt.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9e247e87df..1497e859b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2009-12-02  Eric Blake	<ebb9@byu.net>
+2009-12-01  Eric Blake  <ebb9@byu.net>
+
+	[BZ #11040]
+	* posix/getopt.c (_getopt_internal_r): Reject '-;' as short
+	option, since it conflicts with "W;" optstring extension.
+
+2009-12-02  Eric Blake  <ebb9@byu.net>
 
 	[BZ #11041]
 	* posix/getopt.c (_getopt_internal_r): Handle '-Wfoo' identically
diff --git a/posix/getopt.c b/posix/getopt.c
index 01c1071ecb..b778047cd9 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -789,7 +789,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
     if (*d->__nextchar == '\0')
       ++d->optind;
 
-    if (temp == NULL || c == ':')
+    if (temp == NULL || c == ':' || c == ';')
       {
 	if (print_errors)
 	  {