From 6c2f8f640f59e8a45a6c0c1cff6c17e1655907b9 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 17 May 2024 08:07:18 -0400 Subject: genlang: Strip _all_ leading '~' from dest/voice strings (Instead of just the first) Change-Id: I3c730fd4e570dc5ec77d63777c8499e81f1b0491 --- tools/genlang | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/genlang b/tools/genlang index 24b29b7d9a..45f7bc82d9 100755 --- a/tools/genlang +++ b/tools/genlang @@ -27,7 +27,7 @@ my $SUBHEADER_SIZE = 6; # the ability. But, starting now, this ability is no longer provided since I # figured it was boring and unnecessary to write support for now since we # don't use it anymore. - + if(!$ARGV[0]) { print <) { # get rid of DOS newlines @@ -440,7 +440,7 @@ while() { if($dest eq '""' && $phrase{'desc'} !~ /deprecated/i && $idstr !~ /^VOICE/) { print STDERR "$input:$line:1: warning: empty dest before line in non-deprecated phrase!\n"; } - + my $userstr = trim($phrase{'user'}); my $user = $users{$userstr}; if ($userstr eq "") { @@ -471,12 +471,12 @@ while() { } # Strip out the magic "Same as english" flag - $dest =~ s/^("?)~/$1/; - $voice =~ s/^("?)~/$1/; - + $dest =~ s/^("?)~+/$1/; + $voice =~ s/^("?)~+/$1/; + $id{$idstr} = $idnum; $idnum[$user][$idnum]=$idstr; - + $source{$idstr}=$src; $dest{$idstr}=$dest; $voice{$idstr}=$voice; @@ -529,7 +529,7 @@ if($prefix) { open(HFILE_CORE, ">$prefix/lang.h") || die "Error: couldn't create file $prefix/lang.h\n"; open(CFILE_CORE, ">$prefix/lang_core.c") || - die "Error: couldn't create file $prefix/lang_core.c\n"; + die "Error: couldn't create file $prefix/lang_core.c\n"; # get header file name $headername = "$prefix/lang.h"; @@ -572,7 +572,7 @@ MOO print CFILE_CORE <