Skip to content

Commit

Permalink
Fix is_executable_in_path() on Windows (#10468)
Browse files Browse the repository at this point in the history
* Fix problem that 1byte extra memory was allocated in is_executable_in_path

* Revert "Revert "tests: executable_spec: enable pending test #10443" (#10454)"

This reverts commit 13fbeda.
  • Loading branch information
erw7 authored and blueyed committed Jul 15, 2019
1 parent be949d6 commit 5193826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/nvim/os/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ static bool is_executable_in_path(const char_u *name, char_u **abspath)
#ifdef WIN32
// Prepend ".;" to $PATH.
size_t pathlen = strlen(path_env);
char *path = memcpy(xmallocz(pathlen + 3), "." ENV_SEPSTR, 2);
char *path = memcpy(xmallocz(pathlen + 2), "." ENV_SEPSTR, 2);
memcpy(path + 2, path_env, pathlen);
#else
char *path = xstrdup(path_env);
Expand Down
7 changes: 1 addition & 6 deletions test/functional/eval/executable_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ describe('executable()', function()
eq('arg1=lemon;arg2=sky;arg3=tree;',
call('system', sibling_exe..' lemon sky tree'))
end
local is_executable = call('executable', sibling_exe)
if iswin() and is_executable ~= expected then
pending('XXX: sometimes fails on AppVeyor')
else
eq(expected, is_executable)
end
eq(expected, call('executable', sibling_exe))
end)

describe('exec-bit', function()
Expand Down

0 comments on commit 5193826

Please sign in to comment.