From 95b3896c9660668663a575e1a1b3540bbf35dcf6 Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Mon, 9 May 2016 20:01:29 +0200 Subject: [PATCH] RuleBasedEditor: fix a regexp not compatible with perl 5.8 (SL5) --- src/main/perl/RuleBasedEditor.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/perl/RuleBasedEditor.pm b/src/main/perl/RuleBasedEditor.pm index ba135203..2d6e516d 100644 --- a/src/main/perl/RuleBasedEditor.pm +++ b/src/main/perl/RuleBasedEditor.pm @@ -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 '')) {