[llvm-commits] [llvm] r116927 - /llvm/trunk/lib/System/Win32/Path.inc

Michael J. Spencer bigcheesegs at gmail.com
Wed Oct 20 09:00:45 PDT 2010


Author: mspencer
Date: Wed Oct 20 11:00:45 2010
New Revision: 116927

URL: http://llvm.org/viewvc/llvm-project?rev=116927&view=rev
Log:
Use C++03...

Modified:
    llvm/trunk/lib/System/Win32/Path.inc

Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=116927&r1=116926&r2=116927&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Wed Oct 20 11:00:45 2010
@@ -68,7 +68,12 @@
 struct ScopedNullTerminator {
   std::string &str;
   ScopedNullTerminator(std::string &s) : str(s) { str.push_back(0); }
-  ~ScopedNullTerminator() { str.pop_back(); }
+  ~ScopedNullTerminator() {
+    // str.pop_back(); But wait, C++03 doesn't have this...
+    assert(!str.empty() && str[str.size() - 1] == 0
+      && "Null char not present!");
+    str.resize(str.size() - 1);
+  }
 };
 
 bool





More information about the llvm-commits mailing list