From c0c4f8ae2799259ae7758fcb70e4129a5a5792fc Mon Sep 17 00:00:00 2001
From: Peter Gal <pgal.u-szeged@partner.samsung.com>
Date: Wed, 17 Jun 2015 13:55:30 +0200
Subject: [PATCH] Fix MCU script transformation logic.

The old script behaved incorrectly as it replaced all '*' occurrences
with the list of files in the given directory.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
---
 tools/generator.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/generator.sh b/tools/generator.sh
index e020fe0da2..03cb00328f 100755
--- a/tools/generator.sh
+++ b/tools/generator.sh
@@ -15,9 +15,6 @@
 # limitations under the License.
 
 echo "#define JERRY_MCU_SCRIPT \\" > $2
-cat $1 | while read line
-do
-  line=$(echo $line | sed 's/"/\\"/g')
-  echo "\"$line\n\" \\" >> $2
-done
+# escape all " characters, wrap each line in double quotes and end the line with '\'
+sed 's/"/\\"/g' $1 | sed 's/^.*$/"\0" \\/g' >> $2
 echo >> $2