Skip to content

Commit 0adb388

Browse files
committed
improve behavior of pathname_mkdir on Cygwin
1 parent 25ec2b0 commit 0adb388

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/LaTeXML/Util/Pathname.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,13 @@ sub pathname_mkdir {
249249
return unless $directory;
250250
$directory = pathname_canonical($directory);
251251
my ($volume, $dirs, $last) = File::Spec->splitpath($directory);
252-
my (@dirs) = (File::Spec->splitdir($dirs), $last);
252+
my (@dirs) = File::Spec->splitdir($dirs);
253253
for (my $i = 0 ; $i <= $#dirs ; $i++) {
254254
my $dir = File::Spec->catpath($volume, File::Spec->catdir(@dirs[0 .. $i]), '');
255255
if (!-d $dir) {
256256
mkdir($dir) or return; } }
257+
if (!-d $directory) {
258+
mkdir($directory) or return; }
257259
return $directory; }
258260

259261
# copy a file, preserving attributes, if possible.

0 commit comments

Comments
 (0)