]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
genfs: deal with files with quotation marks in the name
authorAntti Kantee <pooka@iki.fi>
Wed, 10 Feb 2016 15:39:59 +0000 (15:39 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 10 Feb 2016 15:39:59 +0000 (15:39 +0000)
app-tools/genfs.in

index 4076a4e8583672c3d48511bcddd5857865d2452c..2e946b5c7df8455514e2598628eeee9aaf3a160f 100644 (file)
@@ -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