Skip to content

Commit

Permalink
Autoload: Ignore empty and effectively empty commands
Browse files Browse the repository at this point in the history
Fixes #8195.
  • Loading branch information
faho committed Aug 1, 2021
1 parent 97e514d commit 0157ac3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/autoload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class autoload_file_cache_t {
};

maybe_t<autoloadable_file_t> autoload_file_cache_t::locate_file(const wcstring &cmd) const {
// If the command is empty or starts with NULL (i.e. is empty as a path)
// we'd try to source the *directory*, which exists.
// So instead ignore these here.
if (cmd.empty()) return none();
if (cmd[0] == L'\0') return none();
// Re-use the storage for path.
wcstring path;
for (const wcstring &dir : dirs()) {
Expand Down

0 comments on commit 0157ac3

Please sign in to comment.