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. --- script/public-inbox-init | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'script') diff --git a/script/public-inbox-init b/script/public-inbox-init index 6fac4d18..ced88235 100755 --- a/script/public-inbox-init +++ b/script/public-inbox-init @@ -93,8 +93,7 @@ $ng =~ m![^A-Za-z0-9/_\.\-\~\@\+\=:]! and require PublicInbox::Config; my $pi_config = PublicInbox::Config->default_file; -require File::Basename; -my $dir = File::Basename::dirname($pi_config); +my ($dir) = ($pi_config =~ m!(.*?/)[^/]+\z!); require File::Path; File::Path::mkpath($dir); # will croak on fatal errors -- cgit v1.2.3-24-ge0c7