sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit f047068713379ea12b9639dd1a3a34b1a2c33438
parent f59e71673251484dcc627d685cb36de6f6662636
Author: FRIGN <dev@frign.de>
Date:   Mon Apr 20 21:38:46 +0200

tr(1): Show an error when classes and non-classes are mixed

Diffstat:
tr.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/tr.c b/tr.c @@ -197,6 +197,8 @@ main(int argc, char *argv[]) set2ranges = makeset(argv[1], &set2, &set2check); if (dflag == sflag && !set2ranges && !set2check) eprintf("set2 must be non-empty.\n"); + if (argc == 2 && !set2check != !set1check) + eprintf("can't mix classes with non-classes.\n"); if (set2check && set2check != islowerrune && set2check != isupperrune) eprintf("set2 can only be the 'lower' or 'upper' class.\n"); if (set2check && cflag && !dflag)