summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-06-15 22:12:21 +0000
committerMåns Rullgård <mans@mansr.com>2009-06-15 22:12:21 +0000
commitb04251c5d08b8310f88f77b68e77547d76128cc2 (patch)
treeedb70ee445c0fe7d0b2cf05e7f613229d8565085 /configure
parent7cc8d616aab68ba5534e5a74214786ad08aac5ce (diff)
configure: properly quote configure options stored in config.*
Originally committed as revision 19201 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 10 insertions, 4 deletions
diff --git a/configure b/configure
index 38f84a823a..05e5d19122 100755
--- a/configure
+++ b/configure
@@ -283,6 +283,12 @@ c_escape(){
echo "$*" | sed 's/["\\]/\\\0/g'
}
+sh_quote(){
+ v=$(echo "$1" | sed "s/'/'\\\\''/g")
+ test "$v" = "${v#*[ |&;<>()$\`\\\"\'*?\[\]#~=%]}" || v="'$v'"
+ echo "$v"
+}
+
set_all(){
value=$1
shift
@@ -1270,9 +1276,9 @@ else
fi
for v in "$@"; do
- r="${v#*=}"
- l="${v%$r}"
- test "$r" = "${r#* }" || r="'$r'"
+ r=${v#*=}
+ l=${v%"$r"}
+ r=$(sh_quote "$r")
FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
done
@@ -2444,7 +2450,7 @@ echo "# Automatically generated by configure - do not modify!" > config.mak
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIG_H" >> $TMPH
-echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
+echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak