From: Matthias Kruk Date: Wed, 30 Jun 2021 22:36:10 +0000 (+0900) Subject: include/queue: Correctly handle omitted timeout in queue_get_file() X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=63c1dc1380dc461a0cd87fbbdddd57f0ea937cad;p=toolbox include/queue: Correctly handle omitted timeout in queue_get_file() The queue_get_file() function does not correctly interpret the timeout as infinity if the parameter is omitted. This commit adds a check to queue_get_file() so that the timeout is set correctly if the parameter is omitted. --- diff --git a/include/queue.sh b/include/queue.sh index f4c36e3..4bef0fa 100644 --- a/include/queue.sh +++ b/include/queue.sh @@ -430,6 +430,10 @@ queue_get_file() { local dest local err + if (( $# < 3 )); then + timeout=-1 + fi + if ! [ -d "$destdir" ]; then log_error "Destination must be a directory" return 1