File::Next screws up UNC paths
Closed this issue · 2 comments
When you do
ack foo \hostname\some\path
you get
"ack: \hostname\some\path: No such file or directory"
The problem is in File::Next::reslash(): What happens is that something like "//server/share/directory" gets split into (q<>, q<>, 'share', 'directory'), and File::Spec->catfile() only returns a single slash at the front, which is wrong. Why is this being done? If I specify "//server/share/directory", I really want to use the path "//server/share/directory" and not "/server/share/directory", which won't work.
The trouble is that File::Spec->catfile() combines any number of empty sub paths to one /
(as I am sure you have noticed).
I wonder if we should use a regexp to change \ to /
(or would that break other things)
If we do go down that road, we would use the reslash() function that is already in File::Next and used throughout.