comparison libtomcrypt/filter.pl @ 391:00fcf5045160

propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head c1db4398d56c56c6d06ae1e20c1e0d04dbb598ed) to branch 'au.asn.ucc.matt.dropbear' (head d26d5eb2837f46b56a33fb0e7573aa0201abd4d5)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 04:29:08 +0000
parents 0cbe8f6dbf9e
children
comparison
equal deleted inserted replaced
390:d8e44bef7917 391:00fcf5045160
1 #!/usr/bin/perl
2
3 # we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun)
4
5 $dst = shift;
6 $ins = shift;
7
8 open(SRC,"<$dst");
9 open(INS,"<$ins");
10 open(TMP,">tmp.delme");
11
12 $l = 0;
13 while (<SRC>) {
14 if ($_ =~ /START_INS/) {
15 print TMP $_;
16 $l = 1;
17 while (<INS>) {
18 print TMP $_;
19 }
20 close INS;
21 } elsif ($_ =~ /END_INS/) {
22 print TMP $_;
23 $l = 0;
24 } elsif ($l == 0) {
25 print TMP $_;
26 }
27 }
28
29 close TMP;
30 close SRC;