aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-03-04 22:58:34 +0100
committerDiego Biurrun <diego@biurrun.de>2013-03-05 11:04:37 +0100
commitf868b24d0f280bb966e5c352028a343e45d20a02 (patch)
tree16459d3e0c05880e16af9052111facf445de5647 /configure
parent813b82b927b19532e3bc3397b972c8a27b9f6326 (diff)
downloadffmpeg-f868b24d0f280bb966e5c352028a343e45d20a02.tar.gz
configure: Add sanitize_var_name convenience function
This is useful in all the places where special characters in variable names are manually translated to underscores.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure8
1 files changed, 6 insertions, 2 deletions
diff --git a/configure b/configure
index a933546091..157517f406 100755
--- a/configure
+++ b/configure
@@ -408,14 +408,18 @@ set_weak(){
done
}
+sanitize_var_name(){
+ echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
+}
+
set_safe(){
var=$1
shift
- eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
+ eval $(sanitize_var_name "$var")='$*'
}
get_safe(){
- eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
+ eval echo \$$(sanitize_var_name "$1")
}
pushvar(){