toke.c: Under -DT, dump complement properly
authorFather Chrysostomos <sprout@cpan.org>
Wed, 12 Sep 2012 20:31:40 +0000 (13:31 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 12 Sep 2012 23:23:49 +0000 (16:23 -0700)
Before:

$ ./miniperl -DT -e '~foo'
....
### 0:LEX_NORMAL/XSTATE ""
### <== ?? 126
....

After:

$ ./miniperl -DT -e '~foo'
....
### 0:LEX_NORMAL/XSTATE ""
### <== '~'
....

toke.c

index b09f1f9..1db835c 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -433,7 +433,7 @@ S_tokereport(pTHX_ I32 rv, const YYSTYPE* lvalp)
        }
        if (name)
            Perl_sv_catpv(aTHX_ report, name);
-       else if ((char)rv > ' ' && (char)rv < '~')
+       else if ((char)rv > ' ' && (char)rv <= '~')
            Perl_sv_catpvf(aTHX_ report, "'%c'", (char)rv);
        else if (!rv)
            sv_catpvs(report, "EOF");