tests: simplify pathhelp.pm, avoid using external tools - #15111
Closed
vszakats wants to merge 25 commits into
Closed
tests: simplify pathhelp.pm, avoid using external tools#15111vszakats wants to merge 25 commits into
pathhelp.pm, avoid using external tools#15111vszakats wants to merge 25 commits into
Conversation
pathhelp.pm, avoid using external tools
vszakats
force-pushed
the
tests-pathhelp-tidy
branch
from
October 1, 2024 17:42
2ed1416 to
b757634
Compare
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Instead of calling the shell and external tools, rely on Perl functions like `Cwd::getcwd()`, `Cwd::abs_path()`, `Cygwin::posix_to_win_path()`, `Cygwin::win_to_posix_path()` to retrieve the current directory and convert between POSIX and Windows formats. This adds native Windows Perl support, avoids most failure modes and makes format guessing and other internal functions unnecessary. Also: - delete unused `sys_native_path()`. - delete redundant `normalize_path()` because Perl `abs_path()` already does it. Cherry-picked from curl#14949 Closes curl#15111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of calling the shell and external tools, rely on Perl functions
like
Cwd::getcwd(),Cwd::abs_path(),Cygwin::posix_to_win_path(),Cygwin::win_to_posix_path()to retrieve the current directory andconvert between POSIX and Windows formats.
This adds native Windows Perl support, avoids most failure modes and
makes format guessing and other internal functions unnecessary.
Also:
sys_native_path().normalize_path()because Perlabs_path()alreadydoes it.
Cherry-picked from #14949