aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_util.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-07-22 18:26:15 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-07-22 18:26:15 -0700
commit3e3eefc2dcb2e0e31b224703a063e05dc8c67996 (patch)
tree9535fc9f721b7e184bab85a3476b09869d215e4c /parse_util.cpp
parent77b6b0a9b2e7260884064dbac72f17bb5e86431f (diff)
Improvements to new parser. All functions and completions now parse.
Diffstat (limited to 'parse_util.cpp')
-rw-r--r--parse_util.cpp10
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;
}