summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r--src/mongo/shell/shell_utils.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp
index b97e6358b14..09b5335117e 100644
--- a/src/mongo/shell/shell_utils.cpp
+++ b/src/mongo/shell/shell_utils.cpp
@@ -164,10 +164,9 @@ size_t skipOverString(const std::string& code, size_t start, char quote) {
// that the escaping backslash is not itself escaped. Comparisons of start and pos
// are to keep us from reading beyond the beginning of the quoted string.
//
- if (start == pos || code[pos - 1] != '\\' || // previous char was backslash
- start == pos - 1 ||
- code[pos - 2] == '\\' // char before backslash was not another
- ) {
+ if (start == pos || code[pos - 1] != '\\' || // previous char was backslash
+ start == pos - 1 || code[pos - 2] == '\\' // char before backslash was not another
+ ) {
break; // The quote we found was not preceded by an unescaped backslash; it is real
}
++pos; // The quote we found was escaped with backslash, so it doesn't count