[FFmpeg-cvslog] r19201 - trunk/configure

mru subversion
Tue Jun 16 00:12:21 CEST 2009


Author: mru
Date: Tue Jun 16 00:12:21 2009
New Revision: 19201

Log:
configure: properly quote configure options stored in config.*

Modified:
   trunk/configure

Modified: trunk/configure
==============================================================================
--- trunk/configure	Mon Jun 15 16:38:30 2009	(r19200)
+++ trunk/configure	Tue Jun 16 00:12:21 2009	(r19201)
@@ -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 confi
 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



More information about the ffmpeg-cvslog mailing list