summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorJared Crapo <jared@kotfu.net>2017-08-22 11:14:03 -0600
committerJared Crapo <jared@kotfu.net>2017-08-22 11:14:03 -0600
commite3f88038367d6c6ec617ddc84dfcdb91f0dceccf (patch)
tree563c0f384fea30e97b378b51609391f23dcb815a /cmd2.py
parentdeeeeab563854bea6a616a6746ee47915f9fd641 (diff)
downloadcmd2-git-e3f88038367d6c6ec617ddc84dfcdb91f0dceccf.tar.gz
Fix a bug if there is only one slash
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index 384ab064..68ede281 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2341,8 +2341,10 @@ class Cmd2TestCase(unittest.TestCase):
# turn through the loop
start = second_slash_pos + 1
else:
- # no closing slash, treat it all as plain text
- regex += re.escape(s[start:])
+ # No closing slash, we have to add the first slash,
+ # and the rest of the text
+ regex += re.escape(s[start-1:])
+ break
return regex
def _escaped_find(self, regex, s, start, in_regex):