aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-02-28 19:56:19 +0000
committerMåns Rullgård <mans@mansr.com>2009-02-28 19:56:19 +0000
commit72702705415f639cadaaa2d30191eee2667e4a8e (patch)
tree2ecf638a6e7208520c69a4493332e42695dfb302
parent3aa7ac6dd2d23f7b454e8ddb13f7d17e8a83e596 (diff)
downloadffmpeg-72702705415f639cadaaa2d30191eee2667e4a8e.tar.gz
configure: {enable,disable}_safe functions that sanitise arguments
Originally committed as revision 17667 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rwxr-xr-xconfigure12
1 files changed, 9 insertions, 3 deletions
diff --git a/configure b/configure
index a86e80d3de..3f7b4cdacd 100755
--- a/configure
+++ b/configure
@@ -325,6 +325,14 @@ disable_weak(){
set_weak no $*
}
+enable_safe(){
+ enable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
+}
+
+disable_safe(){
+ disable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
+}
+
do_enable_deep(){
for var; do
enabled $var && continue
@@ -566,9 +574,7 @@ check_header(){
log check_header "$@"
header=$1
shift
- var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
- disable $var
- check_cpp "$@" <<EOF && enable $var
+ check_cpp "$@" <<EOF && enable_safe $header || disable_safe $header
#include <$header>
int x;
EOF