]> the.earth.li Git - htag.git/blob - plugins/01checksigsep
Change to debhelper compat level 10
[htag.git] / plugins / 01checksigsep
1 #!/usr/bin/perl -w
2
3 # Copyright (C) 2000-2003 Simon Huggins
4 # checksigsep checks for an existing sigsep and allows you to quit without
5 # adding a new sig.
6
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 2 of the License, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 # for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc., 59
19 # Temple Place, Suite 330, Boston, MA 02111-1307  USA
20
21 use strict;
22
23 return if ($cfg{'msgfile'} eq "-");
24
25 my $msg="";
26 open(MSG, "<$cfg{'msgfile'}") or return;
27 while(<MSG>) {
28         $msg .= $_;
29 }
30 close(MSG);
31 if (grep { /\n-- \n/ } $msg) {
32         my $oldmsg = $msg;
33         print STDERR "Looks like this message already has an unquoted sigsep:\n";
34         $oldmsg =~ s/.*(-- $)/$1/ms;
35         print STDERR $oldmsg;
36         print STDERR "\n\nAdd another? ([N]o/(y)es)\n";
37         $_ = <STDIN>;
38         return 255      if /^q(?:uit)?$/i;
39         return 255      if /^(?:no?|\n)$/i;
40 }
41