diff options
Diffstat (limited to 'src/core/commandbuffer.cc')
-rw-r--r-- | src/core/commandbuffer.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc index 6c4dbca..0d02e6b 100644 --- a/src/core/commandbuffer.cc +++ b/src/core/commandbuffer.cc @@ -207,8 +207,11 @@ void CommandBuffer::exec() void CommandBuffer::complete(std::string &input, size_t &pos) { std::list<std::string> match; - - std::string partial = input.substr(0, pos); + size_t start = 0; + if (input.c_str()[0] == '/' || input.c_str()[0] == '\\') + start = 1; + + std::string partial = input.substr(start, pos); if (!partial.size()) return; aux::to_lowercase(partial); @@ -255,7 +258,7 @@ void CommandBuffer::complete(std::string &input, size_t &pos) if (maxmatch.size() > partial.size()) { if (match.size()==1) maxmatch += ' '; - input.replace(0, pos, maxmatch); + input.replace(start, pos, maxmatch); pos = maxmatch.size(); } |