Comments (9)
Windows searches the current directory first by default anyway:
# argv.exe just dumps argv
C:\Users\Tony\dev\perl\git>copy argv.exe jar.exe
1 file(s) copied.
C:\Users\Tony\dev\perl\git>jar
0: 'jar'
C:\Users\Tony\dev\perl\git>del jar.exe
C:\Users\Tony\dev\perl\git>jar
Usage: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...
Try `jar --help' for more information.
jar.exe
is in the first directory in PATH
So I don't think it matters on Win32.
from perl5.
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: If LIMIT is negative, it is treated as if it were instead arbitrarily large; as many fields as possible are produced.
According to the POSIX Specifications for PATH
, trailing colons are counted as empty elements: A zero-length prefix is a legacy feature that indicates the current working directory. It appears as two adjacent <colon> characters ( "::" ), as an initial <colon> preceding the rest of the list, or as a trailing <colon> following the rest of the list
from perl5.
I am willing to create a PR to fix this, however I'm not sure which other platforms this bug affects.
OS2.pm, Win32.pm, and Unix.pm all use split()
to split the $PATH
variable and as such are likely susceptible to this bug.
I'm not sure the conventions on Windows or OS2, so I am going to wait until I recieve feedback to start a PR.
from perl5.
I am willing to create a PR to fix this, however I'm not sure which other platforms this bug affects. OS2.pm, Win32.pm, and Unix.pm all use
split()
to split the$PATH
variable and as such are likely susceptible to this bug.I'm not sure the conventions on Windows or OS2, so I am going to wait until I recieve feedback to start a PR.
Based on @tonycoz's feedback, I recommend creating a pull request consisting of 2 commits.
The first commit should adjust that split
line in lib/File/Spec/Unix.pm
as you suggest. It should add tests, probably to dist/PathTools/t/Spec.t
that would fail if run today but will pass after your code changes. This first commit should also increment $VERSION
in all .pm
files in the dist/PathTools/
tree in the core distribution (including Cwd.pm
). Please make sure that all the tests in dist/PathTools/t/*.t
PASS, and please make sure that make test_porting
also PASSes.
The second commit should adjust the split
line in lib/File/Spec/OS2.pm
. I'm suggesting that you do that in a second commit because we probably don't have an OS2 available for testing and if we need to back that change out in the future, it will be easier to have it in a commit of its own.
from perl5.
Also, in the first of the two commits, please run perl Porting/updateAUTHORS.pl
to add your name and preferred email address.
from perl5.
@jkeenan Should the second commit (changing OS2.pm
) also increment $VERSION
? Or should $VERSION
only be incremented once?
from perl5.
@jkeenan Should the second commit (changing
OS2.pm
) also increment$VERSION
? Or should$VERSION
only be incremented once?
$VERSION
should only be incremented once, and it should be the same in all *.pm
files in the distribution.
from perl5.
Okay, I'll update them to match. Out of curiosity, why don't the $VERSION
values match in bleed
?
> 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';
from perl5.
Okay, I'll update them to match. Out of curiosity, why don't the
$VERSION
values match inbleed
?> 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.
from perl5.
Related Issues (20)
- test t/io/sem fails on Mac PPC64 HOT 15
- Use of uninitialized value $_[0] in defined operator HOT 1
- [doc] perlfunc our section block unclear HOT 1
- [doc] perlfunc pack snippet has different output HOT 1
- Missing support for undef in for_list assignments HOT 6
- BBC: c844eac triggers failures in Devel::Cover HOT 1
- "@" symbol in directory path results in syntax error in Config_heavy.pl HOT 5
- FreeBSD/arm64: POSIX/t/math.t fails with -Duselongdouble HOT 4
- inconsistent behavior of dup open w/ barewords under `use strict` HOT 1
- 5.40.0 onwards won't build Darwin fat binaries HOT 17
- Segmentation fault in Perl_csighandler3 when used XS with threads. HOT 10
- BBC: Blead Breaks File::Tabular HOT 10
- feature 'class': out of memory error if subclassing a class with an explicit new HOT 3
- t/op/try.t: one test fails during deparsing tests HOT 3
- strftime crashes with a blessed format HOT 3
- [doc] Bug in Perl Threads tutorial section "A Thread Pitfall: Deadlocks"
- BBC: Blead Breaks Mojolicious HOT 3
- Cross compilation HOT 2
- BBC: Blead Breaks CPAN HOT 4
- Class methods can still be replaced outside the class HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perl5.