if (str != ctx->str) {
if (changed++)
printf(" ");
- printf("str=\"%s\"", str ? str : "NULL");
+ printf("str=");
+ litputs(str);
ctx->str = str;
}
printf("\n");
if (strcmp(outbuf, ctx->outbuf) != 0) {
- printf("outbuf=\"%s\"\n", outbuf);
+ printf("outbuf=");
+ litputs(outbuf);
+ putchar('\n');
free(ctx->outbuf);
ctx->outbuf = getcpy(outbuf);
}
litputc(char c)
{
if (c & ~ 0177) {
- putc('M', stdout);
- putc('-', stdout);
- c &= 0177;
- }
- if (c < 0x20 || c == 0177) {
+ printf("\\x%02x", (unsigned char) c);
+ } else if (c < 0x20 || c == 0177) {
if (c == '\b') {
putc('\\', stdout);
putc('b', stdout);