-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[RFC] vim-patch:8.0.1807,8.1.{453,454} #9092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Problem: Function to set terminal name is too long. Solution: Refactor the function. Fix typo in test. vim/vim@69e0569
Problem: resolve() was not tested with a symlink cycle. Solution: Add a test. (Dominique Pelle, closes vim/vim#3513) vim/vim@2610990
Problem: MS-Windows: executable() is not reliable. Solution: Use $PATHEXT properly. (Yasuhiro Matsumoto, closes vim/vim#3412) vim/vim@8295666
src/nvim/testdir/test_functions.vim
Outdated
call assert_equal(1, executable('notepad.exe')) | ||
call assert_equal(0, executable('notepad.exe.exe')) | ||
call assert_equal(0, executable('shell32.dll')) | ||
call assert_equal(0, executable('win.ini')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these not executable? dll
and ini
don't open notepad? As for notepad.exe.exe
, if notepad.exe
was copied/renamed to notepad.exe.exe
, then it is not executable anymore?
Found errors in Test_Executable():
function RunTheTest[35]..Test_Executable line 5: Expected 0 but got 1
function RunTheTest[35]..Test_Executable line 6: Expected 0 but got 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot that executable
checks files in PATH
. shell32.dll
is in PATH
but dll
is not in PATHEXT
by default so it is not executable. win.ini
is in PATH
(C:\Windows\win.ini on Windows 8.1) and opens notepad so it is executable. notepad.exe.exe
is not in PATH
(unless it was created elsewhere) so it is not executable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to merge this, or are you planning to check/fix the PATHEXT logic (if needed)? |
Not sure what to fix. If there's a fix, then it's a file permission issue like in Unix. Using File Explorer to check file properties dialog, there is Security tab that shows the file permissions. One of which is
|
We deal with PATHEXT in
Ah, good point. Anyways, it looks like
|
Sure. |
Windows has "Read and execute" permission via ACL but nvim and libuv do not support ACL. Windows does not support the executable bit in chmod-style permissions but it is safe to assume that if the file exists and is readable, then it is most likely executable. This means that win.ini and shell32.dll are "executable" because they exist, are readable, and are in PATH. PATHEXT does not affect the executable permission of a file; it exists to run files on the shell while omitting the file extension. Assume that PATHEXT is intended for cmd.exe only because powershell can execute powershell files (ie. *.ps1) without changing PATHEXT or related cmd.exe environment variable. In the future, nvim should check the outputs of 'assoc' and 'ftype', cmd.exe internal commands, or check the registry. Powershell can be used for ACL if C++/C# API is too difficult to use.
vim-patch:8.0.1807: function to set terminal name is too long
Problem: Function to set terminal name is too long.
Solution: Refactor the function. Fix typo in test.
vim/vim@69e0569
vim-patch:8.1.0453: MS-Windows: executable() is not reliable
Problem: MS-Windows: executable() is not reliable.
Solution: Use $PATHEXT properly. (Yasuhiro Matsumoto, closes vim/vim#3412)
vim/vim@8295666
vim-patch:8.1.0454: resolve() was not tested with a symlink cycle
Problem: resolve() was not tested with a symlink cycle.
Solution: Add a test. (Dominique Pelle, closes vim/vim#3513)
vim/vim@2610990