aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-01-19 18:07:43 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-01-19 18:07:43 -0800
commitea2a3600f1b8b432c2a1f3adaf873982e9fa489b (patch)
tree93b2a23dfe1f943e49e73ba241a30d28ac344d9d
parent1f130366be64a5a86ac94126384413cc8d07d0df (diff)
downloadcdlog-ea2a3600f1b8b432c2a1f3adaf873982e9fa489b.tar.gz
cdlog-ea2a3600f1b8b432c2a1f3adaf873982e9fa489b.tar.bz2
cdlog-ea2a3600f1b8b432c2a1f3adaf873982e9fa489b.zip
Improve initialization.
* cdlog.sh (toplevel): Ensure that c1 exists, so that the init code doesn't access a nonexistent c1. Condense the assignments in the init block.
-rw-r--r--cdlog.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/cdlog.sh b/cdlog.sh
index 911c606..75b1e01 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -1,15 +1,13 @@
# License at bottom.
# Initialize cdlog the first time.
+
+c1=${c1-}
+
if [ -z "$c1" ] ; then
- c9=
- c8=
- c7=
- c6=
- c5=
- c4=
- c3=
- c2=
+ c9=; c8=; c7=
+ c6=; c5=; c4=
+ c3=; c2=
fi
# One-letter nicknames for most recent four dirs.