{
std::string const & t (editor.text());
// Search backward from e finding the longest valid path. This does *not* accept all valid
- // path's, only those without empedded white-space. However, this is only for completion so
+ // path's, only those without embedded white-space. However, this is only for completion so
// it's ok.
if (b<e) {
unsigned bb (e-1);
ParseCommandInfo::TokensRange::const_iterator i (path.begin());
ParseCommandInfo::TokensRange::const_iterator const i_end (boost::prior(path.end()));
DirectoryNode * dir (& client().cwd());
- std::string basePath;
for (; i != i_end; ++i)
if (*i == NoneToken()) {
if (i == path.begin()) {
dir = & client().root();
- basePath = "/";
+ prefix = "/";
}
}
else if (*i == WordToken("..")) {
DirectoryNode * parent (dir->parent().get());
if (parent) dir = parent;
- basePath += "../";
+ prefix += "../";
}
else if (*i == WordToken("."))
- basePath += "./";
+ prefix += "./";
else {
if (dir->hasChild(i->value())) {
try {
catch (std::bad_cast &) {
return;
}
- basePath += i->value() + "/";
+ prefix += i->value() + "/";
}
else {
DirectoryNode::ChildrenRange cs (dir->completions(i->value()));
if (!node.isDirectory())
return;
dir = static_cast<DirectoryNode*>(&node);
- basePath += cs.begin()->first + "/";
+ prefix += cs.begin()->first + "/";
}
else
return;
}
DirectoryNode::ChildrenRange cs (dir->completions(i->value()));
- prefix = basePath;
for (DirectoryNode::ChildrenRange::iterator j (cs.begin()); j != cs.end(); ++j)
completions.push_back(j->first + (j->second->followLink().isDirectory() ? "/" : " "));
}
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
-#include <boost/functional/hash_fwd.hpp>
+#include <boost/functional/hash.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/prevent_eti.hpp>
#include <boost/mpl/eval_if.hpp>