Problem: When changing to an inaccessible directory fails with E472,
s:NetrwLcd() attempts to assign to the read-only a:newdir
argument and raises E46 instead of returning -1. The fallback
branch also refers to dirname, which is not defined on this path.
Solution: Remove both unused assignments and retain the existing option
restoration and failure return (Qiming zhao).
The failed :lcd leaves the current directory unchanged. Callers use the
function's return value; assigning to its argument cannot update the
caller's directory variable.
The regression test uses a directory without execute permission and covers
both the presence and absence of w:netrw_prvdir. It checks the failure
return, error notification, unchanged working directory, and buffer options.
The test reproduced E46 before the fix and passes after it. It is skipped
on non-Unix systems and when running as root.
Validation: make -j4 completed successfully, with linker warnings about
duplicate -lcairo and -lintl libraries. The full test_plugin_netrw suite
completed with 29 tests passing and 11 skipped for platform or missing
PowerShell dependencies. The new regression test also passed with the
freshly built Vim. All five make codestyle tests passed.
This contribution was developed with assistance from OpenAI Codex.
https://github.com/vim/vim/pull/21226
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()