From 9f608b191956a761f5cbe2b3f0056206d04bd5b2 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Wed, 20 Oct 2010 16:00:45 +0000 Subject: [PATCH] Use C++03... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116927 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/Win32/Path.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index 2dbf13e8ccb..7e2275105a3 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 -- 2.34.1