diff options
author | Diego Biurrun <diego@biurrun.de> | 2017-03-21 12:22:23 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2017-04-03 14:39:08 +0200 |
commit | b62ed6873821c8fce8f7e2c2927ae54f86afeb22 (patch) | |
tree | 9c671b4680afa1a10c307e105bc6d12ee5897742 | |
parent | 604fbb3132e88727e496c96c92cfe02748c25a1a (diff) | |
download | ffmpeg-b62ed6873821c8fce8f7e2c2927ae54f86afeb22.tar.gz |
configure: Better names for functions that sanitize input
-rwxr-xr-x | configure | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -477,13 +477,13 @@ sanitize_var_name(){ echo $@ | sed 's/[^A-Za-z0-9_]/_/g' } -set_safe(){ +set_sanitized(){ var=$1 shift eval $(sanitize_var_name "$var")='$*' } -get_safe(){ +get_sanitized(){ eval echo \$$(sanitize_var_name "$1") } @@ -522,13 +522,13 @@ disable_weak(){ set_weak no $* } -enable_safe(){ +enable_sanitized(){ for var; do enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g') done } -disable_safe(){ +disable_sanitized(){ for var; do disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g') done @@ -937,8 +937,8 @@ check_header(){ log check_header "$@" header=$1 shift - disable_safe $header - check_cpp "$@" <<EOF && enable_safe $header + disable_sanitized $header + check_cpp "$@" <<EOF && enable_sanitized $header #include <$header> int x; EOF @@ -982,7 +982,7 @@ check_func_headers(){ echo "long check_$func(void) { return (long) $func; }" done echo "int main(void) { return 0; }" - } | check_ld "$@" && enable $funcs && enable_safe $headers + } | check_ld "$@" && enable $funcs && enable_sanitized $headers } check_cpp_condition(){ @@ -1080,8 +1080,8 @@ check_type(){ headers=$1 type=$2 shift 2 - disable_safe "$type" - check_code cc "$headers" "$type v" "$@" && enable_safe "$type" + disable_sanitized "$type" + check_code cc "$headers" "$type v" "$@" && enable_sanitized "$type" } check_struct(){ @@ -1090,9 +1090,9 @@ check_struct(){ struct=$2 member=$3 shift 3 - disable_safe "${struct}_${member}" + disable_sanitized "${struct}_${member}" check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && - enable_safe "${struct}_${member}" + enable_sanitized "${struct}_${member}" } check_builtin(){ |