aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2018-07-02 21:44:18 -0700
committerRichard Walters <rwalters@digitalstirling.com>2018-07-02 21:44:18 -0700
commit212980eeb06bb44ff6b9da6fc3f324bdaeaf4929 (patch)
tree2f521122acaba0292aa5e411bd8039e3b23899cd /src
parent1af6861f8db57b54ba19b80964eb00c5f7340bfb (diff)
Add more path normalization tests and fix a bug in it
For normalization "step 2C", if the output path was empty, we don't want to pop the end of it off.
Diffstat (limited to 'src')
-rw-r--r--src/Uri.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Uri.cpp b/src/Uri.cpp
index 35631cf..309ce88 100644
--- a/src/Uri.cpp
+++ b/src/Uri.cpp
@@ -759,7 +759,9 @@ namespace Uri {
&& (oldPath[1] == "..")
) {
oldPath.erase(oldPath.begin() + 1);
- impl_->path.pop_back();
+ if (!impl_->path.empty()) {
+ impl_->path.pop_back();
+ }
} else
// Step 2D