diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-01-18 12:43:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-01-18 12:43:42 -0800 |
commit | f8304eb1eb57b1489a667595700a3e58db614399 (patch) | |
tree | 507f2ef9121cd3cd44007c4260a06a746400257f /cdlog.sh | |
parent | 667a006f81d05acf812910085cb8f55a4ee8c512 (diff) | |
download | cdlog-f8304eb1eb57b1489a667595700a3e58db614399.tar.gz cdlog-f8304eb1eb57b1489a667595700a3e58db614399.tar.bz2 cdlog-f8304eb1eb57b1489a667595700a3e58db614399.zip |
Change semantics of swap implementation.
* cdlog.sh (cdlog.chdir): When the user changes to $c1,
let's not involve $c2 but just effectively exchange
the current working directory and $c1.
Diffstat (limited to 'cdlog.sh')
-rw-r--r-- | cdlog.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |