From: Ian Jackson Date: Sun, 27 Oct 2013 20:30:34 +0000 (+0000) Subject: pregen: wip X-Git-Tag: test~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?p=d.git;a=commitdiff_plain;h=41ae1e70f389ecb19a2a929a89712f2e7d5a8fb6 pregen: wip --- diff --git a/evade-mail-pregen b/evade-mail-pregen index e15ae83..91466a1 100755 --- a/evade-mail-pregen +++ b/evade-mail-pregen @@ -54,7 +54,7 @@ sub run_generator { ($alias,$comment) = ($1,$2); } elsif (m/^\#/) { next; # future extension - } elsif (m/^([^#: ])\: [^#]* (\#.*)$/) { + } elsif (m/^([^#: ]+)\: [^#]* (\#.*)$/) { ($alias,$comment) = ($1,$2); } else { die "generator output $_ ?"; @@ -143,9 +143,10 @@ sub action_list { badusage "invalid arguments to list"; my $num = $min_number; $num ||= 0; - while ($num <= $#by_number) { + for (; $num <= $#by_number; $num++) { my $alias = $by_number[$num]; report $alias if $alias; + $num++; } } @@ -217,7 +218,7 @@ $comment_pattern =~ m/^#/s or badusage "comment pattern must start with \`#'"; $comment_re = $comment_pattern; $comment_re =~ s/\W/\\$&/g; -($comment_re =~ s'\\'([1-9]\d{0,8})'g) == 1 #' +($comment_re =~ s'\\'(0|[1-9]\d{0,8})'g) == 1 #' or badusage "comment pattern (\`$comment_pattern')". " must contain \`' exactly once";