diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-31 09:03:28 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-31 09:03:28 +0000 |
commit | 4b527153ccf2a2830e38038ce4cf06ccc764d310 (patch) | |
tree | e52cf44100bf894f435d6e726f45c680f19a0826 /src/core/commandbuffer.cc | |
parent | da0715c2648b662892a72e32e8528a08608d0d0b (diff) |
fix zlib type issues on 32-bit systems
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(); } |