Fix subsitute_vars() so it doesn't corrupt binary files.
authorMartin Schwenke <martin@meltin.net>
Fri, 27 May 2011 06:37:00 +0000 (16:37 +1000)
committerMartin Schwenke <martin@meltin.net>
Fri, 27 May 2011 06:37:00 +0000 (16:37 +1000)
commit6dd33e9b5a7e9589c34242d18e92a0188b647222
treea5c52a3719ca81d3bb80ab084e7b11e38b5c8e0f
parentce22745dcb6b23504829673f45abada4b4666be8
Fix subsitute_vars() so it doesn't corrupt binary files.

Treating the file contents as a string in bash will almost always
corrupt binary files - at least any containing a NUL character.

This changes the code to use a temporary file rather than a string, so
none of this silliness occurs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
autocluster