develooper Front page | perl.perl5.porters | Postings from January 2008

[PATCH] fix for regression to File/DosGlob.pm

Thread Next
From:
Davies, Alex
Date:
January 30, 2008 09:39
Subject:
[PATCH] fix for regression to File/DosGlob.pm
Message ID:
A69AA663CE9BBC44AE1DA72483DE15DE07E02181@HQ-MAIL3.ptcnet.ptc.com

File/DosGlob's handling of drive relative glob patterns (eg. "D:*pl")
was broken by a code cleanup in change 8013 (back in 2000!).

Here's the patch to restore the functionality:

--- DosGlob.pm-orig     2008-01-30 17:32:03.282701700 +0000
+++ DosGlob.pm  2008-01-30 17:32:15.282164100 +0000
@@ -35,7 +35,7 @@
        # wildcards with a drive prefix such as h:*.pm must be changed
        # to h:./*.pm to expand correctly
        if ($pat =~ m|^([A-Za-z]:)[^/\\]|s) {
-           substr($_,0,2) = $1 . "./";
+           substr($pat,0,2) = $1 . "./";
        }
        if ($pat =~ m|^(.*)([\\/])([^\\/]*)\z|s) {
            ($head, $sepchr, $tail) = ($1,$2,$3);

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About