aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsbofixinfo10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbofixinfo b/sbofixinfo
index c4ba522..eeba16e 100755
--- a/sbofixinfo
+++ b/sbofixinfo
@@ -150,6 +150,12 @@ $errcnt = 0;
fix_info($_) for @ARGV;
exit $errcnt;
+sub fix_key {
+ my $key = shift;
+ $key =~ tr/-a-wyz/_A-WYZ/; # leave "x" lowercase!
+ return $key;
+}
+
sub fix_info {
my $file = shift;
if(-d $file) {
@@ -180,11 +186,13 @@ sub fix_info {
s/^(\w+)\s*=\s*/$1=/; # remove spaces around =
if(/^(\w+)=(.*)$/) {
- $key = uc $1;
+ $key = $1;
$val = $2;
$val =~ s,(?:^['"]|['"]$),,g; # remove quotes around value
$val =~ s,[\s\\]*$,,; # remove any line-continuation backslash
+ $key = fix_key($key);
+
if($key =~ /^MD5SUM/) {
$val =~ tr/A-Z/a-z/;
}