diff options
author | 2013-07-22 18:26:15 -0700 | |
---|---|---|
committer | 2013-07-22 18:26:15 -0700 | |
commit | 3e3eefc2dcb2e0e31b224703a063e05dc8c67996 (patch) | |
tree | 9535fc9f721b7e184bab85a3476b09869d215e4c /parse_util.cpp | |
parent | 77b6b0a9b2e7260884064dbac72f17bb5e86431f (diff) |
Improvements to new parser. All functions and completions now parse.
Diffstat (limited to 'parse_util.cpp')
-rw-r--r-- | parse_util.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/parse_util.cpp b/parse_util.cpp index 5e6f4459..6f291345 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -245,10 +245,10 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc const wchar_t * const cursor = buff + cursor_pos; CHECK(buff,); - + const size_t bufflen = wcslen(buff); assert(cursor_pos <= bufflen); - + /* ap and bp are the beginning and end of the tightest command substitition found so far */ const wchar_t *ap = buff, *bp = buff + bufflen; const wchar_t *pos = buff; @@ -260,13 +260,13 @@ 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 */ if (end == NULL) { end = const_cast<wchar_t *>(buff) + bufflen; } - + if (begin < cursor && end >= cursor) { /* This command substitution surrounds the cursor, so it's a tighter fit */ @@ -288,7 +288,7 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc assert(pos <= buff + bufflen); } } - + if (a != NULL) *a = ap; if (b != NULL) *b = bp; } |