File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ sub err {
2727 close $f ;
2828}
2929
30+ my $line = ' ' ;
3031while (<>) {
3132 chomp ;
33+ $line .= $_ ;
3234 # stitch together incomplete lines (those ending with "\")
33- while (s /\\ $// ) {
34- $_ .= readline;
35- chomp ;
36- }
35+ next if $line =~ s /\\ $// ;
3736
37+ $_ = $line ;
3838 / \b cp\s +-a/ and err ' cp -a is not portable' ;
3939 / \b sed\s +-[^efn]\s +/ and err ' sed option not portable (use only -n, -e, -f)' ;
4040 / \b echo\s +-[neE]/ and err ' echo with option is not portable (use printf)' ;
@@ -48,6 +48,7 @@ sub err {
4848 / \b export\s +[A-Za-z0-9_]*=/ and err ' "export FOO=bar" is not portable (use FOO=bar && export FOO)' ;
4949 / ^\s *([A-Z0-9_]+=(\w +|(["']).*?\3 )\s +)+(\w +)/ and exists ($func {$4 }) and
5050 err ' "FOO=bar shell_func" assignment extends beyond "shell_func"' ;
51+ $line = ' ' ;
5152 # this resets our $. for each file
5253 close ARGV if eof ;
5354}
You can’t perform that action at this time.
0 commit comments