summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2021-01-22 20:17:03 +0100
committerclsr <clsr@clsr.net>2021-01-22 20:17:03 +0100
commite108dac02bdae43a5657f7fd075551ea2018df70 (patch)
treefe11c7e194da16fe10aed6c45f468ec75280aa69
parent4dcfff1e04ad38f36ba14ee68f4477f88ff3b227 (diff)
downloadbl-2.0.0.tar.gz
bl-2.0.0.zip
Strip leading zeroes from arg to prevent parsing as octalv2.0.0v2
-rwxr-xr-xbl6
1 files changed, 6 insertions, 0 deletions
diff --git a/bl b/bl
index d66422b..a88eebe 100755
--- a/bl
+++ b/bl
@@ -106,6 +106,12 @@ get_raw_new() {
printf "expected a number for brightness, but got '%s'\n" "$val" >&2
exit 2
fi
+ while :; do
+ case "$val" in
+ 0*) val="${val#0}" ;;
+ *) break ;;
+ esac
+ done
case "$op" in
+) : $(( new = curr + val )) ;;