From 4c6f9a39621fdae852e0655b7db3d61f03c716c5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 11 Aug 2021 11:26:16 +0000 Subject: treewide: use *nix-specific dirname regexps None of our code elsewhere accounts for non-*nix pathnames and it's not worth our time to start. So stop wasting CPU cycles giving the illusion that we'd care about non-*nix pathnames. --- lib/PublicInbox/OverIdx.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/OverIdx.pm') diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index 8f7cf2bb..e0893337 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -463,8 +463,8 @@ sub create { }; unless (-r $fn) { require File::Path; - require File::Basename; - File::Path::mkpath(File::Basename::dirname($fn)); + my ($dir) = ($fn =~ m!(.*?/)[^/]+\z!); + File::Path::mkpath($dir); } # create the DB: PublicInbox::Over::dbh($self); -- cgit v1.2.3-24-ge0c7