Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand: garbage collect a global #900

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions bin/expand
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ my $Program = basename($0);
my %line_desc;
my $tabstop = 8;
my @tabstops;
my @files;

while (@ARGV && $ARGV[0] =~ /\A\-(.+)/) {
my $val = $1;
Expand All @@ -46,12 +45,10 @@ while (@ARGV && $ARGV[0] =~ /\A\-(.+)/) {
last;
}
@tabstops = split /,/, $val;
usage(1) if grep /\D/, @tabstops; # only integer arguments are allowed
usage() if grep /\D/, @tabstops; # only integer arguments are allowed
shift @ARGV;
}

@files = @ARGV;

# $tabstop is used only if multiple tab stops have not been defined
if(scalar @tabstops == 0) {
$tabstop = 8;
Expand All @@ -68,7 +65,7 @@ if(scalar @tabstops == 0) {
}
}

for my $file (@files) {
for my $file (@ARGV) {
my $in;
unless (open $in, '<', $file) {
warn "$Program: couldn't open '$file' for reading: $!\n";
Expand All @@ -79,7 +76,7 @@ for my $file (@files) {
}
close $in;
}
unless (@files) {
unless (@ARGV) {
while (<>) {
expand_line($_);
}
Expand Down
Loading