From 212980eeb06bb44ff6b9da6fc3f324bdaeaf4929 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Mon, 2 Jul 2018 21:44:18 -0700 Subject: 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. --- src/Uri.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3