Mercurial > dropbear
comparison tomsfastmath/filter.pl @ 643:a362b62d38b2 dropbear-tfm
Add tomsfastmath from git rev bfa4582842bc3bab42e4be4aed5703437049502a
with Makefile.in renamed
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 23 Nov 2011 18:10:20 +0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
642:33fd2f3499d2 | 643:a362b62d38b2 |
---|---|
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; |