diff options
| author | Jared Crapo <jared@kotfu.net> | 2017-08-22 11:14:03 -0600 |
|---|---|---|
| committer | Jared Crapo <jared@kotfu.net> | 2017-08-22 11:14:03 -0600 |
| commit | e3f88038367d6c6ec617ddc84dfcdb91f0dceccf (patch) | |
| tree | 563c0f384fea30e97b378b51609391f23dcb815a /cmd2.py | |
| parent | deeeeab563854bea6a616a6746ee47915f9fd641 (diff) | |
| download | cmd2-git-e3f88038367d6c6ec617ddc84dfcdb91f0dceccf.tar.gz | |
Fix a bug if there is only one slash
Diffstat (limited to 'cmd2.py')
| -rwxr-xr-x | cmd2.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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): |
