Changeset View
Changeset View
Standalone View
Standalone View
contrib/ee/ee.c
Show First 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | |||||
int argc; | int argc; | ||||
char *argv[]; | char *argv[]; | ||||
{ | { | ||||
int counter; | int counter; | ||||
for (counter = 1; counter < 24; counter++) | for (counter = 1; counter < 24; counter++) | ||||
signal(counter, SIG_IGN); | signal(counter, SIG_IGN); | ||||
/* Always read from (and write to) a terminal. */ | |||||
if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) { | |||||
fprintf(stderr, | |||||
"ee's standard input and output must be a terminal\n"); | |||||
exit(1); | |||||
} | |||||
signal(SIGCHLD, SIG_DFL); | signal(SIGCHLD, SIG_DFL); | ||||
signal(SIGSEGV, SIG_DFL); | signal(SIGSEGV, SIG_DFL); | ||||
signal(SIGINT, edit_abort); | signal(SIGINT, edit_abort); | ||||
d_char = malloc(3); /* provide a buffer for multi-byte chars */ | d_char = malloc(3); /* provide a buffer for multi-byte chars */ | ||||
d_word = malloc(150); | d_word = malloc(150); | ||||
*d_word = '\0'; | *d_word = '\0'; | ||||
d_line = NULL; | d_line = NULL; | ||||
dlt_line = txtalloc(); | dlt_line = txtalloc(); | ||||
▲ Show 20 Lines • Show All 4,784 Lines • Show Last 20 Lines |