Skip to content

Commit da511ac

Browse files
committed
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" =~ '--'`.
1 parent 7fe79d0 commit da511ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build-ffmpeg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ while (( $# > 0 )); do
179179
if [[ "$1" == "--build" || "$1" =~ 'b' ]]; then
180180
bflag='-b'
181181
fi
182-
if [[ "$1" == "--cleanup" || "$1" =~ 'c' ]]; then
182+
if [[ "$1" == "--cleanup" || "$1" =~ 'c' && ! "$1" =~ '--' ]]; then
183183
cflag='-c'
184184
cleanup
185185
fi

0 commit comments

Comments
 (0)