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