Skip to content

Commit

Permalink
Completing .. behaves more like Bash (closes #277).
Browse files Browse the repository at this point in the history
  • Loading branch information
mridgers committed Feb 16, 2015
1 parent 7df7a20 commit d5eff6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 7 additions & 2 deletions clink/dll/dir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ function dir_match_generator_impl(text)
prefix = text:sub(1, i)
end

local include_dots = text:find("%.+$") ~= nil

local matches = {}
local mask = text.."*"

-- Find matches.
for _, dir in ipairs(clink.find_dirs(mask, true)) do
local file = prefix..dir
if clink.is_match(text, file) then
table.insert(matches, prefix..dir)

if include_dots or (dir ~= "." and dir ~= "..") then
if clink.is_match(text, file) then
table.insert(matches, prefix..dir)
end
end
end

Expand Down
8 changes: 0 additions & 8 deletions readline/compat/dirent.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@ struct dirent *readdir(DIR *dir)
continue;
}

// Skip . and ..
if (wcscmp(dir->info.name, L".") == 0 ||
wcscmp(dir->info.name, L"..") == 0)
{
dir->result.d_name = "";
continue;
}

WideCharToMultiByte(
CP_UTF8,
0,
Expand Down

0 comments on commit d5eff6d

Please sign in to comment.