Patch from Dmytro Bagrii
Fix fbrun completion search for last directory in PATH
This commit is contained in:
parent
dd238f9d95
commit
ee9c0a34ba
1 changed files with 2 additions and 2 deletions
|
@ -508,8 +508,8 @@ void FbRun::tabCompleteApps() {
|
||||||
first_run = false;
|
first_run = false;
|
||||||
std::string path = getenv("PATH");
|
std::string path = getenv("PATH");
|
||||||
FbTk::Directory dir;
|
FbTk::Directory dir;
|
||||||
for (unsigned int l = 0, r = 0; r < path.size(); ++r) {
|
for (unsigned int l = 0, r = 0; r <= path.size(); ++r) {
|
||||||
if ((path.at(r) == ':' || r == path.size() - 1) && r - l > 1) {
|
if ((r == path.size() || path.at(r) == ':') && r - l > 1) {
|
||||||
dir.open(path.substr(l, r - l).c_str());
|
dir.open(path.substr(l, r - l).c_str());
|
||||||
prefix = dir.name() + (*dir.name().rbegin() == '/' ? "" : "/");
|
prefix = dir.name() + (*dir.name().rbegin() == '/' ? "" : "/");
|
||||||
int n = dir.entries();
|
int n = dir.entries();
|
||||||
|
|
Loading…
Reference in a new issue