Skip to content

Commit

Permalink
RuleBasedEditor: fix a regexp not compatible with perl 5.8 (SL5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jouvin committed May 9, 2016
1 parent a3a4a03 commit 95b3896
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/perl/RuleBasedEditor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ sub _formatAttributeValue
# Quote value if necessary (only for shell variables).
# If you do not want the line interpolated, use explicit single quotes.
if (($line_fmt == LINE_FORMAT_SH_VAR) || ($line_fmt == LINE_FORMAT_ENV_VAR)) {
if ( (($formatted_value =~ /\s+/) && ($formatted_value !~ /^(["']).*\g1$/))
# In the regexp, \g1 would have been better than \1 but is not supported
# in perl 5.8 (SL5). \1 seems to achieve the same result in this context.
if ( (($formatted_value =~ /\s+/) && ($formatted_value !~ /^(["']).*\1$/))
|| ($value_fmt == LINE_VALUE_BOOLEAN)
|| ($formatted_value eq ''))
{
Expand Down

0 comments on commit 95b3896

Please sign in to comment.