mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-06 12:37:44 +00:00
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.
This commit is contained in:
parent
813b82b927
commit
f868b24d0f
8
configure
vendored
8
configure
vendored
@ -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(){
|
||||
|
Loading…
Reference in New Issue
Block a user