From 2ae6009448cba9a8095a55915a192a5222bfd94c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 1 Feb 2005 19:00:37 +0000 Subject: Keep comments other than the special ### comments. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5735 a1c6a512-1295-4272-9138-f99709370657 --- tools/uplang | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tools/uplang') diff --git a/tools/uplang b/tools/uplang index d290a79d37..5fb9563c22 100755 --- a/tools/uplang +++ b/tools/uplang @@ -37,13 +37,24 @@ while() { close(ENG); undef %set; +my $cblock = 1; open(NEW, "<$ARGV[1]"); while() { + $_ =~ s/\r//g; + if($_ =~ /^ *\#/) { # comment + if($_ !~ /^ *\#\#\#/) { + # no special ### comment -> keep it + if(!$cblock) { + print "\n"; + $cblock = 1; + } + print $_; + } next; } - $_ =~ s/\r//g; + $cblock = 0; if($_ =~ /^ *([a-z]+): *(.*)/) { ($var, $value) = ($1, $2); @@ -54,7 +65,7 @@ while() { # the last one for a single phrase if(!$ids{$set{'id'}}) { - print "### ".$set{'id'}." was not found in the english file!\n"; + print "\n### ".$set{'id'}." was not found in the english file!\n"; next; } -- cgit v1.2.3