diff options
author | Karl Berry <karl@freefriends.org> | 2011-06-09 22:40:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-06-09 22:40:03 +0000 |
commit | 0c98f8e358024d44e131625b4ecdcdb0baa7b6b1 (patch) | |
tree | f720825628eb01b27260c8a74fd9162c01bd82a3 /Build/source/utils/biber | |
parent | 84d55c5c9b8767ddcba1899370e3e3aebb22fa8a (diff) |
sync
git-svn-id: svn://tug.org/texlive/trunk@22896 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/biber')
-rw-r--r-- | Build/source/utils/biber/TeXLive/TLUtils.pm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Build/source/utils/biber/TeXLive/TLUtils.pm b/Build/source/utils/biber/TeXLive/TLUtils.pm index 6bc850337ed..148da69e22f 100644 --- a/Build/source/utils/biber/TeXLive/TLUtils.pm +++ b/Build/source/utils/biber/TeXLive/TLUtils.pm @@ -5,7 +5,7 @@ package TeXLive::TLUtils; -my $svnrev = '$Revision: 22842 $'; +my $svnrev = '$Revision: 22870 $'; my $_modulerevision; if ($svnrev =~ m/: ([0-9]+) /) { $_modulerevision = $1; @@ -525,13 +525,23 @@ Return C<$path> with its trailing C</component> removed. sub dirname { my $path=shift; - if (win32) { + my $drive=''; + if (&win32) { $path=~s!\\!/!g; } - if ($path=~m!/!) { # dirname("foo/bar/baz") -> "foo/bar" - $path=~m!(.*)/.*!; # works because of greedy matching - return $1; - } else { # dirname("ignore") -> "." + if ($path=~m!^[A-Za-z]\:!) { + $path=~ s/^(.\:)(.*)/$1,$2/; + ($drive, $path)=($1,$2); + } + if ($path=~m!/!) { + $path=~m!(.*)/.*!; # works because of greedy matching + my $dir=$1; + if (length($dir)) { # dirname("foo/bar/baz") -> "foo/bar" + return "$drive$dir"; + } else { # dirname("/baz") -> "/" + return "$drive/"; + } + } else { # dirname("ignore") -> "." return "."; } } |