X-Git-Url: https://git.treefish.org/fex.git/blobdiff_plain/c65ee6f7429eff9a7f58aad7c0aec858ad473092..20160328:/bin/fpg diff --git a/bin/fpg b/bin/fpg index be610fe..5f2f751 100755 --- a/bin/fpg +++ b/bin/fpg @@ -8,7 +8,7 @@ # 2003-02-27 Framstag initial version # 2003-02-28 Framstag added exit status # 2007-03-09 Framstag added option -Q -# 2007-06-01 Framstag added options -s and -c +# 2007-06-01 Framstag added options -s and -c # and changed default output mode # 2007-06-03 Framstag added ReadLine-support # 2007-08-31 Framstag added option -x @@ -27,7 +27,7 @@ sub usage { die <) { $_ .= "\n" unless /\n$/; if ($opt_M) { @@ -248,9 +248,9 @@ sub grepf { $C{0} = [$l,$_]; } if ($opt_e) { - if ($opt_v) { + if ($opt_v) { next if &$egrep; - } else { + } else { unless (&$egrep) { if ($opt_C and $c) { print "$l:" if $opt_n; @@ -276,16 +276,16 @@ sub grepf { if ($opt_Q) { $n++ while /$exp/mg } else { $n++ while /$exp/omg } } else { - if ($opt_o) { + if ($opt_o) { my $m = ''; while (s/($exp)//) { $n++; $m .= "$1\n"; } $_ = $m; - } elsif ($opt_Q) { + } elsif ($opt_Q) { $n += s/($exp)/$B$1$N/mg; - } else { + } else { $n += s/($exp)/$B$1$N/omg; } } @@ -309,7 +309,7 @@ sub grepf { $file = ''; } if ($opt_x and $n) { - if ($opt_i) { s/($opt_x)/$B$1$N/ogi } + if ($opt_i) { s/($opt_x)/$B$1$N/ogi } else { s/($opt_x)/$B$1$N/og } } for (my $i=$opt_C;$i;$i--) { @@ -327,7 +327,7 @@ sub grepf { $L{$l} = $l; $c = $opt_C; } - + if ($opt_c) { print "$file:" if @ARGV>1; print "$found\n";