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