OSDN Git Service

* docs/html/21_strings/gotw29a.txt: Update code to corrected version.
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Jun 2005 16:26:13 +0000 (16:26 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Jun 2005 16:26:13 +0000 (16:26 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101130 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/docs/html/21_strings/gotw29a.txt

index dc56f54..649c017 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-17  Jonathan Wakely  <redi@gcc.gnu.org>
+
+       * docs/html/21_strings/gotw29a.txt: Update code to corrected version.
+
 2005-06-17  Jakub Jelinek  <jakub@redhat.com>
             Benjamin Kosnik  <bkoz@redhat.com>
 
index d823f30..9326604 100644 (file)
@@ -119,10 +119,14 @@ the easiest way:
       while( n-- > 0 && tolower(*s) != tolower(a) ) {
           ++s;
       }
-      return s;
+      return n >= 0 ? s : 0;
     }
   };
 
+[N.B. A bug in the original code has been fixed for the
+GCC documentation, the corrected code was taken from
+Herb Sutter's book, Exceptional C++]
+
 And finally, the key that brings it all together:
 
   typedef basic_string<char, ci_char_traits> ci_string;