Skip to content

Commit b3d007f

Browse files
author
Peter Souter
committed
(MODULES-1582) Improve % detection
Avoids any validate commands that have %'s in them other than "... % ..."
1 parent cc8b147 commit b3d007f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet/parser/functions/validate_cmd.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module Puppet::Parser::Functions
3939
tmpfile.write(content)
4040
tmpfile.close
4141

42-
if checkscript.include?('%')
42+
if checkscript =~ /\s%(\s|$)/
4343
check_with_correct_location = checkscript.gsub(/%/,tmpfile.path)
4444
else
4545
check_with_correct_location = "#{checkscript} #{tmpfile.path}"

0 commit comments

Comments
 (0)