Skip to content

Commit 84bd986

Browse files
author
Peter Souter
committed
(MODULES-444) - Real meat of the change
This is the core change, we now go through the array and add it to the first element, instead of just two arguments.
1 parent 594c2dd commit 84bd986

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/puppet/parser/functions/concat.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ module Puppet::Parser::Functions
2121
"given (#{arguments.size} for < 2)") if arguments.size < 2
2222

2323
a = arguments[0]
24-
b = arguments[1]
2524

2625
# Check that the first parameter is an array
2726
unless a.is_a?(Array)
2827
raise(Puppet::ParseError, 'concat(): Requires array to work with')
2928
end
3029

31-
result = a + Array(b)
30+
result = a
31+
arguments.shift
32+
33+
arguments.each do |x|
34+
result = result + Array(x)
35+
end
3236

3337
return result
3438
end

0 commit comments

Comments
 (0)