Project

General

Profile

« Previous | Next » 

Revision 38365d82

Added by Adam Ruzicka over 1 year ago

Fixes #35530 - Make save_to_file macro safer (#9426)

  • Fixes #35530 - Make save_to_file macro safer

save_to_file does

cat <<EOF >$file
$content
EOF

but if `$content` contains a heredoc terminated with `EOF`, it
terminates the heredoc that save_to_file creates.

This fix prefixes each line of $content with a space and then pipes the
result into sed to trim the one leading space away.

  • Fixes #35530 - Update snapshots
  • added
  • modified
  • copied
  • renamed
  • deleted