Changes to make autosuggestion smarter about not suggesting commands that could never succeed.

This commit is contained in:
ridiculousfish
2012-02-16 00:24:27 -08:00
parent a92d9d442b
commit a08450bcb6
11 changed files with 536 additions and 255 deletions

View File

@@ -497,10 +497,13 @@ void path_make_canonical( wcstring &path )
{
/* Remove double slashes */
replace_all(path, L"//", L"/");
size_t size;
do {
size = path.size();
replace_all(path, L"//", L"/");
} while (path.size() != size);
/* Remove trailing slashes */
size_t size = path.size();
while (size--) {
if (path.at(size) != L'/')
break;