提交 b0590a53 编写于 作者: J Ján Tomko

test-wrap-argv: hold a copy of the original file in an array

This will be useful to check if the file is wrapped already.
上级 80880fd4
......@@ -33,15 +33,15 @@ sub rewrap {
# Read the original file
open FILE, "<", $file or die "cannot read $file: $!";
my @lines;
while (<FILE>) {
my @orig_lines = <FILE>;
close FILE;
my @lines = @orig_lines;
foreach (@lines) {
# If there is a trailing '\' then kill the new line
if (/\\$/) {
chomp;
$_ =~ s/\\$//;
}
push @lines, $_;
}
# Skip empty files
......@@ -49,7 +49,6 @@ sub rewrap {
# Kill the last new line in the file
chomp @lines[$#lines];
close FILE;
# Reconstruct the master data by joining all lines
# and then split again based on the real desired
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册