-
Notifications
You must be signed in to change notification settings - Fork 555
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
Bug: File::Spec->path() doesn't keep trailing empty elements #22346
Comments
This bug is in ..../File/Spec/Unix.pm perl5/dist/PathTools/lib/File/Spec/Unix.pm Line 256 in bb1192d
Here, split should be passed a negative value for LIMIT: According to the POSIX Specifications for |
I am willing to create a PR to fix this, however I'm not sure which other platforms this bug affects. I'm not sure the conventions on Windows or OS2, so I am going to wait until I recieve feedback to start a PR. |
Windows searches the current directory first by default anyway:
So I don't think it matters on Win32. |
Based on @tonycoz's feedback, I recommend creating a pull request consisting of 2 commits. The first commit should adjust that The second commit should adjust the |
Also, in the first of the two commits, please run |
@jkeenan Should the second commit (changing |
|
Okay, I'll update them to match. Out of curiosity, why don't the > git sw -q blead && grep -r 'our \$VERSION =' dist/PathTools/
dist/PathTools/Cwd.pm:our $VERSION = '3.90';
dist/PathTools/lib/File/Spec.pm:our $VERSION = '3.90';
dist/PathTools/lib/File/Spec/Cygwin.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/Epoc.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/VMS.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/Functions.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/AmigaOS.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/Win32.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/Mac.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/OS2.pm:our $VERSION = '3.91';
dist/PathTools/lib/File/Spec/Unix.pm:our $VERSION = '3.91'; |
Error on our part. I have submitted #22404 to correct. Thanks for spotting that. |
Module: File::Spec
Description
Tested on Linux, but likely an issue on other platforms as well.
File::Spec->path() accidentally trims trailing empty elements in
$PATH
due to it's use ofsplit()
without aLIMIT
.Steps to Reproduce
Expected behavior
File::Spec->path() should include trailing empty elements.
Perl configuration
The text was updated successfully, but these errors were encountered: