summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/mixin/template.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb
index f88263f34f..54aa65c488 100644
--- a/lib/chef/mixin/template.rb
+++ b/lib/chef/mixin/template.rb
@@ -140,6 +140,10 @@ class Chef
end
if windows_line_endings
+ # Convert line endings from "\n" -> "\r\n". Also converts
+ # "\r\n" -> "\r\n".
+ # This makes the regex match on all of "\r\n", so we don't
+ # accidentally convert "\r\n" -> "\r\r\n".
output = output.gsub(/\r?\n/,"\r\n")
end