File: gen-msgcat

package info (click to toggle)
http-analyze 2.4-2.1
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 3,344 kB
  • ctags: 924
  • sloc: ansic: 11,678; perl: 241; sh: 215; makefile: 214
file content (28 lines) | stat: -rwxr-xr-x 555 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

while ($_ = &get_line()) {
        next if /^\$.*/;

	s/(^\d+) //;
	$lline = $1;
	$line++;
	print;
}
if ($line != $lline) {
	print STDERR "Converted $line lines, but last message no. was $lline\n";
	exit(1);
}
exit(0);

# get a line, combining continuation lines
sub get_line {
        $nextline = "";
        line: while ($nextline .= <>) {
                if ($nextline =~ /(.*)\\\n/) {
                        $nextline = $1;
                } else {
                        last line;
                }
        }
        $nextline;
}