From c3532aa41422aa4ac0ddc70f0d94640e9cc4cffc Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Wed, 10 Feb 2016 15:39:59 +0000 Subject: [PATCH] genfs: deal with files with quotation marks in the name --- app-tools/genfs.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app-tools/genfs.in b/app-tools/genfs.in index 4076a4e..2e946b5 100644 --- a/app-tools/genfs.in +++ b/app-tools/genfs.in @@ -100,7 +100,7 @@ checkpaths () done } -stripleading () +processfspath () { n=$1 @@ -121,7 +121,7 @@ stripleading () shift done - echo ${rpath%/} + echo ${rpath%/} | sed 's/"/\\"/g' } FILES= @@ -142,7 +142,7 @@ makedirlist () printf 'static const char *dirlist[] = {\n' for d in ${DIRS}; do - printf '\t"/%s",\n' $(stripleading ${STRIPCOUNT} $d) + printf '\t"/%s",\n' $(processfspath ${STRIPCOUNT} $d) done printf '};\n\n' } @@ -189,7 +189,7 @@ makeelfdata () fn=0 for f in ${FILES}; do setfilevars %{f} - printf '\t{ "/%s",\n' $(stripleading ${STRIPCOUNT} "${f}") + printf '\t{ "/%s",\n' $(processfspath ${STRIPCOUNT} "${f}") printf '\t { (void *)&%s_start,\n' ${rf} printf '\t (size_t)(uintptr_t)&%s_size} },\n' ${rf} done -- 2.39.5