Raw byte export

This commit is contained in:
Devine Lu Linvega 2024-05-13 15:31:14 -07:00
parent 5419d9579a
commit 97a686913c
2 changed files with 4 additions and 5 deletions

View File

@ -1,7 +1,7 @@
?(?: ?:) \#48 ?(?: ?:) \#48
?(?: ?:) \101 ?(?: ?:) \#65
?(?: ?:) \#6c
?(?: ?:) \#6c ?(?: ?:) \#6c
?(?: ?:) \108
?(?: ?:) \#6f ?(?: ?:) \#6f
?(?: ?:) \#ce ?(?: ?:) \#ce

View File

@ -83,15 +83,14 @@ device_write(char *s)
char *cap = walk(s); char *cap = walk(s);
if(*s == '(') s++, --cap; if(*s == '(') s++, --cap;
while(s < cap) { while(s < cap) {
char c = *s++; char c = *s++, hb, lb;
if(c == '\\') { if(c == '\\') {
switch(*s++) { switch(*s++) {
case 't': putc(0x09, stdout); break; case 't': putc(0x09, stdout); break;
case 'n': putc(0x0a, stdout); break; case 'n': putc(0x0a, stdout); break;
case 's': putc(0x20, stdout); break; case 's': putc(0x20, stdout); break;
default: putc(sint(--s), stdout), s = walk(s); case '#': hb = *s++, lb = *s++, putc((chex(hb) << 4) | chex(lb), stdout); break;
} }
} else } else
putc(c, stdout); putc(c, stdout);
} }