ash: fix "char == CTLfoo" comparison signedness bug
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 30 Mar 2018 21:03:29 +0000 (23:03 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 30 Mar 2018 21:04:39 +0000 (23:04 +0200)
It usually does not bite since bbox forces -funsigned-char build.
But for some reason void linux people disabled that.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index c957b001e997b34c80e70ac659f1f12187117af2..8fb32c1ae682a435f55c75927a96df9da9feb383 100644 (file)
@@ -7439,13 +7439,13 @@ hasmeta(const char *p)
                p = strpbrk(p, chars);
                if (!p)
                        break;
-               switch ((unsigned char) *p) {
+               switch ((unsigned char)*p) {
                case CTLQUOTEMARK:
                        for (;;) {
                                p++;
-                               if (*p == CTLQUOTEMARK)
+                               if ((unsigned char)*p == CTLQUOTEMARK)
                                        break;
-                               if (*p == CTLESC)
+                               if ((unsigned char)*p == CTLESC)
                                        p++;
                                if (*p == '\0') /* huh? */
                                        return 0;