sbase

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

commit 7be2449aa9281c072dc2de33a8818a548dc40ad2
parent bfcf46ac5eae942a123498c0aa356ee9f647ba72
Author: FRIGN <dev@frign.de>
Date:   Mon, 20 Apr 2015 21:38:46 +0200

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

Diffstat:
Mtr.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)