mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-22 20:57:53 +00:00
Fixed bug #45939: {2} in {= =} fails.
This commit is contained in:
parent
285e9209a4
commit
a7ac76158f
11
src/parallel
11
src/parallel
|
@ -8353,11 +8353,14 @@ sub new {
|
|||
$posrpl = $rpl;
|
||||
if($posrpl =~ s/^\{//) {
|
||||
# Only do this if the shorthand start with {
|
||||
s{\{(-?\d+)\Q$posrpl\E}
|
||||
{\257<$1 $Global::rpl{$rpl}\257>}g;
|
||||
while(s{((^|\257>)[^\257]*?) # Don't replace after \257 unless \257>
|
||||
\{(-?\d+)\Q$posrpl\E}
|
||||
{$1\257<$3 $Global::rpl{$rpl}\257>}xg) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Add {} if no replacement strings in @command
|
||||
($replacecount_ref, $len_ref, @command) =
|
||||
replacement_counts_and_lengths($return_files,@command);
|
||||
|
@ -9077,9 +9080,9 @@ sub new {
|
|||
sub Q {
|
||||
# Q alias for ::shell_quote_scalar
|
||||
# Run shell_quote_scalar once to set the reference to the sub
|
||||
my @a = ::shell_quote_scalar(@_);
|
||||
my $a = ::shell_quote_scalar(@_);
|
||||
*Q = \&::shell_quote_scalar;
|
||||
return @a;
|
||||
return $a;
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -202,6 +202,10 @@ parallel -k echo '{=1 $_=++$::G =}' ::: {1001..1004} ::: {a..c}
|
|||
|
||||
echo '**'
|
||||
|
||||
echo '### bug #45939: {2} in {= =} fails'
|
||||
parallel echo '{= s/O{2}//=}' ::: OOOK
|
||||
parallel echo '{2}-{=1 s/O{2}//=}' ::: OOOK ::: OK
|
||||
|
||||
EOF
|
||||
echo '### 1 .par file from --files expected'
|
||||
find /tmp{/*,}/*.{par,tms,tmx} 2>/dev/null -mmin -10 | wc -l
|
||||
|
|
|
@ -430,5 +430,11 @@ parallel -k echo '{=1 $_=++$::G =}' ::: {1001..1004} ::: {a..c}
|
|||
12
|
||||
echo '**'
|
||||
**
|
||||
echo '### bug #45939: {2} in {= =} fails'
|
||||
### bug #45939: {2} in {= =} fails
|
||||
parallel echo '{= s/O{2}//=}' ::: OOOK
|
||||
OK
|
||||
parallel echo '{2}-{=1 s/O{2}//=}' ::: OOOK ::: OK
|
||||
OK-OK
|
||||
### 1 .par file from --files expected
|
||||
1
|
||||
|
|
Loading…
Reference in a new issue