mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
parallel: Bugfix: empty line and --colsep
This commit is contained in:
parent
cc7d613040
commit
428faf33b7
|
@ -4239,7 +4239,11 @@ sub get_column {
|
|||
}
|
||||
my $line = get_line_from_fh($fh);
|
||||
if(defined $line) {
|
||||
if($line ne "") {
|
||||
push @$unget_ref, split /$::opt_colsep/o, $line;
|
||||
} else {
|
||||
push @$unget_ref, "";
|
||||
}
|
||||
$::opt_N = $#$unget_ref+1;
|
||||
$Global::max_number_of_args = $::opt_N;
|
||||
debug("col_unget_ref: @$unget_ref\n");
|
||||
|
|
|
@ -60,3 +60,6 @@ echo '### Test of -C'
|
|||
echo '### Test of --trim n'
|
||||
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --trim n --colsep %+ echo '"{1}_{3}_{2}_{4}"'
|
||||
parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"' ::: 'a% c %%b' 'a%c% b %d'
|
||||
|
||||
echo '### Test of bug: If input is empty string'
|
||||
(echo ; echo abcbdbebf;echo abc) | parallel --colsep b -v echo {1}{2}
|
||||
|
|
|
@ -65,3 +65,10 @@ a_b_\ c\ _{4}
|
|||
a_\ b\ _c_d
|
||||
a_b_c_{4}
|
||||
a_b_c_d
|
||||
### Test of bug: If input is empty string
|
||||
echo {2}
|
||||
{2}
|
||||
echo ac
|
||||
ac
|
||||
echo ac
|
||||
ac
|
||||
|
|
Loading…
Reference in a new issue