projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9cf7b8
)
Use C++03...
author
Michael J. Spencer
<bigcheesegs@gmail.com>
Wed, 20 Oct 2010 16:00:45 +0000
(16:00 +0000)
committer
Michael J. Spencer
<bigcheesegs@gmail.com>
Wed, 20 Oct 2010 16:00:45 +0000
(16:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116927
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/System/Win32/Path.inc
patch
|
blob
|
history
diff --git
a/lib/System/Win32/Path.inc
b/lib/System/Win32/Path.inc
index 2dbf13e8ccbb5052155944e66bfe52aff6ec7463..7e2275105a320f6bf15c429f2ec729adefdcd61d 100644
(file)
--- 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