From 37e23e3c25fb49aa748b26d76fd46d03e6b64d42 Mon Sep 17 00:00:00 2001 From: barbudreadmon Date: Sat, 11 Nov 2023 10:01:42 +0100 Subject: [PATCH] gamelist.pl: better guess for sourcefile --- src/dep/scripts/gamelist.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dep/scripts/gamelist.pl b/src/dep/scripts/gamelist.pl index d476d10100..036e321896 100755 --- a/src/dep/scripts/gamelist.pl +++ b/src/dep/scripts/gamelist.pl @@ -147,10 +147,12 @@ $Drivers{$name}[8] = ""; } - my $sourcefile = $filename; - $sourcefile =~ s/..\/..\/burn\/drv\///; # libretro only ? - $sourcefile =~ s/src\/burn\/drv\///; # all other builds ? - $Drivers{$name}[9] = $sourcefile; # Filename + my @parts = split /\//, $filename; + my $size_of_parts = @parts; + my $sourcefile = "$parts[$size_of_parts-2]/$parts[$size_of_parts-1]"; + # we still want to remove burn/ from burn/d_parent.cpp + $sourcefile =~ s/drv\///; + $Drivers{$name}[9] = $sourcefile; # Filename # Convert NULL/null/0 to empty string or remove quotes foreach $line ( @{$Drivers{$name}} ) {