comments; do not break out of options on a non-IAC
This commit is contained in:
parent
f18f1e401a
commit
24575e61ec
@ -213,14 +213,21 @@ int main(int argc, char ** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the alarm handler to execute the longjmp */
|
||||||
signal(SIGALRM, SIGALRM_handler);
|
signal(SIGALRM, SIGALRM_handler);
|
||||||
|
|
||||||
/* Negotiate options */
|
/* Negotiate options */
|
||||||
if (!setjmp(environment)) {
|
if (!setjmp(environment)) {
|
||||||
|
/* We will stop handling options after one second */
|
||||||
alarm(1);
|
alarm(1);
|
||||||
|
|
||||||
|
/* Let's do this */
|
||||||
while (!feof(stdin) && !done) {
|
while (!feof(stdin) && !done) {
|
||||||
|
/* Get either IAC (start command) or a regular character (break, unless in SB mode) */
|
||||||
unsigned char i = getchar();
|
unsigned char i = getchar();
|
||||||
unsigned char opt = 0;
|
unsigned char opt = 0;
|
||||||
if (i == IAC) {
|
if (i == IAC) {
|
||||||
|
/* If IAC, get the command */
|
||||||
i = getchar();
|
i = getchar();
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case SE:
|
case SE:
|
||||||
@ -286,8 +293,6 @@ int main(int argc, char ** argv) {
|
|||||||
sb[sb_len] = i;
|
sb[sb_len] = i;
|
||||||
sb_len++;
|
sb_len++;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
goto ready;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user