Replacing a regex, for portability.
Reported-by: Stefan Eissing
Bug: https://github.com/curl/curl/issues/17871#issuecomment-
3051830614
Cherry-picked from #17877
Closes #17900
use warnings;
use 5.006;
+use File::Basename;
+
BEGIN {
use base qw(Exporter);
my $fileContent = join('', @inputfile);
# make directories if needed
- my $path = $filename;
- # cut off the file name part
- $path =~ s/^(.*)\/[^\/]*/$1/;
+ my $path = dirname($filename);
my @ldparts = split(/\//, $LOGDIR);
my $nparts = @ldparts;
my @parts = split(/\//, $path);