aboutsummaryrefslogtreecommitdiff
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-10-20 16:00:45 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-10-20 16:00:45 +0000
commit9f608b191956a761f5cbe2b3f0056206d04bd5b2 (patch)
tree621011a37be2274ee559e45cdd6ccafeb802ecd6 /lib/System/Win32
parenta9cf7b84435951ab2ce7d4d9629bc4619226264a (diff)
Use C++03...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Path.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 2dbf13e8cc..7e2275105a 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -68,7 +68,12 @@ Path::operator=(StringRef that) {
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