aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index c8531e4..f82ab89 100644
--- a/vis.c
+++ b/vis.c
@@ -616,7 +616,11 @@ static void op_case_change(OperatorContext *c) {
size_t rem = len;
for (char *cur = buf; rem > 0; cur++, rem--) {
if (isascii((unsigned char)*cur)) {
- if (c->arg->i > 0)
+ if (c->arg->i == 0) {
+ *cur = islower((unsigned char)*cur) ?
+ toupper((unsigned char)*cur) :
+ tolower((unsigned char)*cur) ;
+ } else if (c->arg->i > 0)
*cur = toupper((unsigned char)*cur);
else
*cur = tolower((unsigned char)*cur);