diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index 0ffd5531242aa71c28abd7fa778f34c392c42311..408bfd0216da0b93f0040806842075fb8eab3d19 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -98,7 +98,7 @@ sub parse_abi {
 	$name =~ s,.*/,,;
 
 	my $fn = $file;
-	$fn =~ s,Documentation/ABI/,,;
+	$fn =~ s,.*Documentation/ABI/,,;
 
 	my $nametag = "File $fn";
 	$data{$nametag}->{what} = "File $name";