|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 420 (0x1a4)
Types: TextFile
Names: »to_ansi.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Ularn/to_ansi.c«
/*
* convert ascii sequence '^[' into escape characters
*/
#include <stdio.h>
main()
{
int c, c2;
while ((c = getc(stdin)) != EOF) {
if (c == '^') {
if ((c2 = getc(stdin)) != EOF) {
if (c2 == '[')
putc('\033', stdout);
else {
putc((char)c, stdout);
putc((char)c2, stdout);
}
} else {
putc((char)c, stdout);
exit(0);
}
} else
putc((char)c, stdout);
}
exit(0);
}