aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-02-08 20:17:18 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-02-08 20:17:18 -0800
commitdbfbebee76ad3e58ef472b2da8acd98b461857a4 (patch)
treef5ab91be3d0b2a48a413c0f270d54a7010a19731
parent82bdc9e8ce75c44979701ef052f038e2a9a4448e (diff)
downloadcdlog-dbfbebee76ad3e58ef472b2da8acd98b461857a4.tar.gz
cdlog-dbfbebee76ad3e58ef472b2da8acd98b461857a4.tar.bz2
cdlog-dbfbebee76ad3e58ef472b2da8acd98b461857a4.zip
bugfix: don't let user select invalid context number.
* cdlog.sh (cdlog.get_param): Only produce output if shift succeeds. If shift fails, it means that many shifts are not possible and the parameters are unaffected.
-rw-r--r--cdlog.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/cdlog.sh b/cdlog.sh
index 32c65de..c909d65 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -37,8 +37,9 @@ cdlog.args()
# Utility for nth positional param
cdlog.get_param()
{
- shift $1
+ if shift $1 ; then
echo "$1"
+ fi
}
# Read state from ~/.cdlog.dirs