File: reap.pl

package info (click to toggle)
mutt 0.91.2-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 2,056 kB
  • ctags: 2,189
  • sloc: ansic: 34,582; sh: 203; makefile: 197; perl: 21; awk: 2
file content (26 lines) | stat: -rwxr-xr-x 391 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
#!/usr/bin/perl
#
# A small script to strip out any "illegal" PGP code to make sure it is
# safe for International export.
#
$word = shift;
$illegal = 0;
$count = 0;
while (<>)
{
	if (/^#if/)
	{
		if (/${word}/) { $illegal = 1; }
		if ($illegal) { $count++; }
	}
	elsif ($illegal && /^#endif/)
	{
		$count--;
		if ($count == 0)
		{
			$illegal = 0;
			next;
		}
	}
	print if (! $illegal);
}