From ee9c0a34baadbae98c510b1bf1b8c720a33c6f56 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Tue, 6 Jul 2021 16:10:30 -0700 Subject: Patch from Dmytro Bagrii Fix fbrun completion search for last directory in PATH --- util/fbrun/FbRun.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 5404e69..0f8ff63 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -508,8 +508,8 @@ void FbRun::tabCompleteApps() { first_run = false; std::string path = getenv("PATH"); FbTk::Directory dir; - for (unsigned int l = 0, r = 0; r < path.size(); ++r) { - if ((path.at(r) == ':' || r == path.size() - 1) && r - l > 1) { + for (unsigned int l = 0, r = 0; r <= path.size(); ++r) { + if ((r == path.size() || path.at(r) == ':') && r - l > 1) { dir.open(path.substr(l, r - l).c_str()); prefix = dir.name() + (*dir.name().rbegin() == '/' ? "" : "/"); int n = dir.entries(); -- cgit v0.11.2