aboutsummaryrefslogtreecommitdiffstats
path: root/cdlog.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cdlog.sh')
-rw-r--r--cdlog.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/cdlog.sh b/cdlog.sh
index 403dc04..f65a90e 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -30,10 +30,10 @@ cdlog.chdir()
# only if we successfully change to a different
# directory do the following
- if [ "$cur" == "$c2" ] && [ "$PWD" == "$c1" ] ; then
- # Special case: if we changed to the directory that is second
- # in the cdlog, then just swap between those two.
- c2=$PWD
+ if [ "$PWD" == "$c1" ] ; then
+ # If we changed to the directory that is most
+ # recent in the cdlog, then we just replace that
+ # entry by the one we are coming from.
c1=$cur
else
# Otherwise rotate through all