view libtommath/filter.pl @ 1660:26e07f7f682a

MOTD enabled by default as the manpage says (#87) The man page (https://github.com/mkj/dropbear/blob/master/dropbear.8) says MOTD will be printed by default for any login shell, but it was disabled at compile time. Probably happened by accident when this code was moved from `options.h` to `default_options.h`.
author zciendor <37557036+zciendor@users.noreply.github.com>
date Sat, 14 Mar 2020 14:21:01 +0000
parents 8bba51a55704
children
line wrap: on
line source

#!/usr/bin/perl

# we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun)

use strict;
use warnings;

open(my $src, '<', shift);
open(my $ins, '<', shift);
open(my $tmp, '>', 'tmp.delme');

my $l = 0;
while (<$src>) {
   if ($_ =~ /START_INS/) {
      print {$tmp} $_;
      $l = 1;
      while (<$ins>) {
         print {$tmp} $_;
      }
      close $ins;
   } elsif ($_ =~ /END_INS/) {
      print {$tmp} $_;
      $l = 0;
   } elsif ($l == 0) {
      print {$tmp} $_;
   }
}

close $tmp;
close $src;

# ref:         $Format:%D$
# git commit:  $Format:%H$
# commit time: $Format:%ai$