From da511ac14245b6b6b7e157a670b69332818ad3b8 Mon Sep 17 00:00:00 2001 From: Frankie Dintino Date: Sun, 22 Nov 2020 10:04:41 -0500 Subject: [PATCH] The check for the cleanup flag in $1 also matches --full-static There is an ambiguity in how short and long cli flags are passed that causes the script to clean whenever a full-static build is attempted with long cli option `--full-static``. The second clause of the conditional that checks for the cleanup flag if [[ "$1" == "--cleanup" || "$1" =~ 'c' ]]; then is overly broad and evaluates as truthy if $1 is "--full-cleanup". This can be easily fixed by appending an additional string check against the string "==", e.g `! "$1" =~ '--'`. --- build-ffmpeg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-ffmpeg b/build-ffmpeg index b172de4c..1cde5909 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -179,7 +179,7 @@ while (( $# > 0 )); do if [[ "$1" == "--build" || "$1" =~ 'b' ]]; then bflag='-b' fi - if [[ "$1" == "--cleanup" || "$1" =~ 'c' ]]; then + if [[ "$1" == "--cleanup" || "$1" =~ 'c' && ! "$1" =~ '--' ]]; then cflag='-c' cleanup fi