mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
b0e7263a58
Changed XMLterm escape sequence string terminator from ^G to CRLF to allow use with buffered STDOUT.
28 lines
583 B
C
28 lines
583 B
C
/* teststream.c: Test driver to generate escaped stream data */
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
char* cookie;
|
|
|
|
cookie = getenv("LTERM_COOKIE"); /* Get security cookie */
|
|
if (cookie == NULL)
|
|
cookie = "";
|
|
|
|
if (argc < 2) {
|
|
fprintf(stderr, "Usage: %s <data-string> [<terminator-string>]\n",argv[0]);
|
|
return 1;
|
|
}
|
|
|
|
if (argc > 2) {
|
|
/* NOT IMPLEMENTED YET */
|
|
fprintf(stdout, "\033{T%s\n%s%s", argv[2], argv[1], argv[2]);
|
|
|
|
} else {
|
|
fprintf(stdout, "\033{S%s\n%s%c", cookie, argv[1], '\0');
|
|
}
|
|
|
|
return 0;
|
|
}
|