DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦1333e4e48⟧ TextFile

    Length: 410 (0x19a)
    Types: TextFile
    Names: »to_ansi.c.orig«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Ularn/to_ansi.c.orig« 

TextFile

/*
 * 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);
	}
}