lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] (no subject)


From: Greg Chicares
Subject: [lmi-commits] (no subject)
Date: Sat, 4 Jun 2016 16:56:38 +0000 (UTC)

branch: master
commit 464747123d388551b9c142c4642e8ad2a1c48b6c
Author: Gregory W. Chicares <address@hidden>
Date:   Sat Jun 4 16:53:35 2016 +0000

    Fix an obvious error in the GNU C++ library's getopt
---
 getopt.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/getopt.cpp b/getopt.cpp
index d26e11a..4e32573 100644
--- a/getopt.cpp
+++ b/getopt.cpp
@@ -182,8 +182,11 @@ GetOpt::Initialize  (std::string const& a_optstring)
 
   // Determine how to handle the ordering of options and nonoptions.
 
-  if (nullptr == a_optstring.c_str())
+  // GWC replaced an erroneous test comparing nullptr to
+  // a_optstring.c_str(), which cannot be a null pointer:
+  if (a_optstring.empty())
     {
+      // GWC comment: the next line is apparently pleonastic.
       noptstring = "";
       if (std::getenv ("_POSIX_OPTION_ORDER"))
         ordering = REQUIRE_ORDER;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]