From b19495a93c4b5da2f35da6038082ba855ca3658d Mon Sep 17 00:00:00 2001
From: Narvin Singh <Narvin.A.Singh@gmail.com>
Date: Tue, 16 Feb 2021 14:10:37 -0500
Subject: [PATCH] Fix: Treat date +%S as decimal instead of octal

The number of seconds elapsed in the current minute given by date
is a 2-digit number. That means seconds 0 to 9 have a leading 0,
which causes them to be interpreted as octal numbers. This is not
intended, but doesn't actually break things (because 00 to 07 octal
are equivalent to 0 to 7 decimal) until second 8 or 9, at which point
we get an error because 08 and 09 are invalid octal numbers.
---
 avds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avds b/avds
index d3b94d4..dde335b 100755
--- a/avds
+++ b/avds
@@ -87,7 +87,7 @@ while [[ "${first_run}" -eq 1 || -n "${repeat}" ]]; do
     else
       case "${when}" in
         m)
-          sleep $((60 - $(date +%S)))
+          sleep $((60 - 10#$(date +%S)))
           ;;
         h)
           readarray -t ms < <(date +'%M%n%S')