aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-09-22 19:47:59 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-09-22 19:47:59 -0700
commit6e41b2f2e22bd41c243042616ddccd1dae3511b9 (patch)
tree57f85a7b7d9cdf8036893e329a1bd701794a3d21
parent7f8c16e5d957c9fd29bdcc1fae2e62371f7bd34a (diff)
Only toggle sort direction if it was the first sort and it was ~'d.
-rw-r--r--bb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bb.c b/bb.c
index c508db2..32f3706 100644
--- a/bb.c
+++ b/bb.c
@@ -392,7 +392,7 @@ void set_sort(bb_t *bb, const char *sort)
char *found;
if ((found = strchr(bb->sort, s[1]))) {
if (*s == '~')
- *s = found[-1] == '+' ? '-' : '+';
+ *s = found[-1] == '+' && found == &bb->sort[1] ? '-' : '+';
memmove(found-1, found+1, strlen(found+1)+1);
} else if (*s == '~')
*s = '+';