Skip to content

Commit e302595

Browse files
committed
Fix minor bug (references #596)
1 parent 26fbb65 commit e302595

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

file2ldif.pl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ sub replace_value {
228228
my $sub;
229229
my $attr;
230230
my $value;
231+
my @result;
231232

232233
# Check subroutine presence
233234
if ( $key =~ m/\((.*)\)(.*)/ ) {
@@ -247,14 +248,18 @@ sub replace_value {
247248

248249
foreach my $val (@$value) {
249250

251+
my $safe_val = $val;
252+
250253
# Trim begin and end whitespaces
251-
$val =~ s/^\s+|\s+$//g;
254+
$safe_val =~ s/^\s+|\s+$//g;
252255

253256
# Apply subroutine if any
254-
$val = &apply_sub( $val, $sub ) if ($sub);
257+
$safe_val = &apply_sub( $val, $sub ) if ($sub);
258+
259+
push @result, $safe_val;
255260
}
256261

257-
return $value;
262+
return \@result;
258263
}
259264

260265
# Create the new values

0 commit comments

Comments
 (0)