diff options
author | 2013-10-16 01:48:21 -0700 | |
---|---|---|
committer | 2013-10-16 01:48:21 -0700 | |
commit | 630b0515ad494225c8c8532670ffd3d1e2359140 (patch) | |
tree | 6e13c910165de92d30f08a83c23e285c31e90898 /parse_util.cpp | |
parent | b06e7983733578d783bc585e7b0fc95f401b2e8d (diff) | |
parent | 3b25795ee5760b29cd0498f15dfb0d30f8638138 (diff) |
Merge branch 'master' into ast
Conflicts:
parse_util.cpp
Diffstat (limited to 'parse_util.cpp')
-rw-r--r-- | parse_util.cpp | 6 |
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) |