aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_util.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-10-16 01:48:21 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-10-16 01:48:21 -0700
commit630b0515ad494225c8c8532670ffd3d1e2359140 (patch)
tree6e13c910165de92d30f08a83c23e285c31e90898 /parse_util.cpp
parentb06e7983733578d783bc585e7b0fc95f401b2e8d (diff)
parent3b25795ee5760b29cd0498f15dfb0d30f8638138 (diff)
Merge branch 'master' into ast
Conflicts: parse_util.cpp
Diffstat (limited to 'parse_util.cpp')
-rw-r--r--parse_util.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse_util.cpp b/parse_util.cpp
index 6427e249..df55e444 100644
--- a/parse_util.cpp
+++ b/parse_util.cpp
@@ -296,8 +296,7 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
/* No subshell found, all done */
break;
}
-
- /* Intrepret NULL to mean the end */
+ /* Interpret NULL to mean the end */
if (end == NULL)
{
end = const_cast<wchar_t *>(buff) + bufflen;
@@ -309,6 +308,9 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
begin++;
ap = begin;
bp = end;
+ /* pos is where to begin looking for the next one. But if we reached the end there's no next one. */
+ if (begin >= end)
+ break;
pos = begin + 1;
}
else if (begin >= cursor)