362 |
for (i = 1; i < argc; i++) { |
for (i = 1; i < argc; i++) { |
363 |
if ((s = GETSEND(argv[i])) == 0) { |
if ((s = GETSEND(argv[i])) == 0) { |
364 |
fprintf(stderr, "Telnet 'send' error - argument disappeared!\n"); |
fprintf(stderr, "Telnet 'send' error - argument disappeared!\n"); |
365 |
(void) quit(); |
quit(); |
366 |
/*NOTREACHED*/ |
/*NOTREACHED*/ |
367 |
} |
} |
368 |
if (s->handler) { |
if (s->handler) { |
1311 |
arg = argv[1]; |
arg = argv[1]; |
1312 |
else { |
else { |
1313 |
printf("new escape character: "); |
printf("new escape character: "); |
1314 |
(void) fgets(buf, sizeof(buf), stdin); |
fgets(buf, sizeof(buf), stdin); |
1315 |
arg = buf; |
arg = buf; |
1316 |
} |
} |
1317 |
if (arg[0] != '\0') |
if (arg[0] != '\0') |
1319 |
if (!In3270) { |
if (!In3270) { |
1320 |
printf("Escape character is '%s'.\n", control(escape)); |
printf("Escape character is '%s'.\n", control(escape)); |
1321 |
} |
} |
1322 |
(void) fflush(stdout); |
fflush(stdout); |
1323 |
return 1; |
return 1; |
1324 |
} |
} |
1325 |
|
|
1330 |
crmod = !crmod; |
crmod = !crmod; |
1331 |
printf("Deprecated usage - please use 'toggle crmod' in the future.\n"); |
printf("Deprecated usage - please use 'toggle crmod' in the future.\n"); |
1332 |
printf("%s map carriage return on output.\n", crmod ? "Will" : "Won't"); |
printf("%s map carriage return on output.\n", crmod ? "Will" : "Won't"); |
1333 |
(void) fflush(stdout); |
fflush(stdout); |
1334 |
return 1; |
return 1; |
1335 |
} |
} |
1336 |
|
|
1344 |
long oldrows, oldcols, newrows, newcols, err; |
long oldrows, oldcols, newrows, newcols, err; |
1345 |
|
|
1346 |
err = (TerminalWindowSize(&oldrows, &oldcols) == 0) ? 1 : 0; |
err = (TerminalWindowSize(&oldrows, &oldcols) == 0) ? 1 : 0; |
1347 |
(void) kill(0, SIGTSTP); |
kill(0, SIGTSTP); |
1348 |
/* |
/* |
1349 |
* If we didn't get the window size before the SUSPEND, but we |
* If we didn't get the window size before the SUSPEND, but we |
1350 |
* can get them now (?), then send the NAWS to make sure that |
* can get them now (?), then send the NAWS to make sure that |
1404 |
_exit(1); |
_exit(1); |
1405 |
} |
} |
1406 |
default: |
default: |
1407 |
(void)wait((int *)0); /* Wait for the shell to complete */ |
wait((int *)0); /* Wait for the shell to complete */ |
1408 |
|
|
1409 |
if (TerminalWindowSize(&newrows, &newcols) && connected && |
if (TerminalWindowSize(&newrows, &newcols) && connected && |
1410 |
(err || ((oldrows != newrows) || (oldcols != newcols)))) { |
(err || ((oldrows != newrows) || (oldcols != newcols)))) { |
1427 |
extern int resettermname; |
extern int resettermname; |
1428 |
|
|
1429 |
if (connected) { |
if (connected) { |
1430 |
(void) shutdown(net, 2); |
shutdown(net, 2); |
1431 |
printf("Connection closed.\n"); |
printf("Connection closed.\n"); |
1432 |
(void) NetClose(net); |
NetClose(net); |
1433 |
connected = 0; |
connected = 0; |
1434 |
resettermname = 1; |
resettermname = 1; |
1435 |
#if defined(AUTHENTICATION) || defined(ENCRYPTION) |
#if defined(AUTHENTICATION) || defined(ENCRYPTION) |
1452 |
int |
int |
1453 |
quit() |
quit() |
1454 |
{ |
{ |
1455 |
(void) call(bye, "bye", "fromquit", 0); |
call(bye, "bye", "fromquit", 0); |
1456 |
Exit(0); |
Exit(0); |
1457 |
/*NOTREACHED*/ |
/*NOTREACHED*/ |
1458 |
} |
} |
1462 |
logout() |
logout() |
1463 |
{ |
{ |
1464 |
send_do(TELOPT_LOGOUT, 1); |
send_do(TELOPT_LOGOUT, 1); |
1465 |
(void) netflush(); |
netflush(); |
1466 |
return 1; |
return 1; |
1467 |
} |
} |
1468 |
|
|
2152 |
} |
} |
2153 |
# if !defined(TN3270) |
# if !defined(TN3270) |
2154 |
printf("Escape character is '%s'.\n", control(escape)); |
printf("Escape character is '%s'.\n", control(escape)); |
2155 |
(void) fflush(stdout); |
fflush(stdout); |
2156 |
# else /* !defined(TN3270) */ |
# else /* !defined(TN3270) */ |
2157 |
if ((!In3270) && ((argc < 2) || strcmp(argv[1], "notmuch"))) { |
if ((!In3270) && ((argc < 2) || strcmp(argv[1], "notmuch"))) { |
2158 |
printf("Escape character is '%s'.\n", control(escape)); |
printf("Escape character is '%s'.\n", control(escape)); |
2176 |
printf("Transparent mode command is '%s'.\n", transcom); |
printf("Transparent mode command is '%s'.\n", transcom); |
2177 |
} |
} |
2178 |
# endif /* defined(unix) */ |
# endif /* defined(unix) */ |
2179 |
(void) fflush(stdout); |
fflush(stdout); |
2180 |
if (In3270) { |
if (In3270) { |
2181 |
return 0; |
return 0; |
2182 |
} |
} |
2191 |
int |
int |
2192 |
ayt_status() |
ayt_status() |
2193 |
{ |
{ |
2194 |
(void) call(status, "status", "notmuch", 0); |
call(status, "status", "notmuch", 0); |
2195 |
} |
} |
2196 |
#endif |
#endif |
2197 |
|
|
2224 |
} |
} |
2225 |
if (argc < 2) |
if (argc < 2) |
2226 |
{ |
{ |
2227 |
(void) strcpy(line, "open "); |
strcpy(line, "open "); |
2228 |
printf("(to) "); |
printf("(to) "); |
2229 |
(void) fgets(&line[strlen(line)], sizeof(line) - strlen(line), stdin); |
fgets(&line[strlen(line)], sizeof(line) - strlen(line), stdin); |
2230 |
makeargv(); |
makeargv(); |
2231 |
argc = margc; |
argc = margc; |
2232 |
argv = margv; |
argv = margv; |
2504 |
env_define((unsigned char *)"USER", (unsigned char *)user); |
env_define((unsigned char *)"USER", (unsigned char *)user); |
2505 |
env_export((unsigned char *)"USER"); |
env_export((unsigned char *)"USER"); |
2506 |
} |
} |
2507 |
(void) call(status, "status", "notmuch", 0); |
call(status, "status", "notmuch", 0); |
2508 |
if (setjmp(peerdied) == 0) |
if (setjmp(peerdied) == 0) |
2509 |
telnet(user); |
telnet(user); |
2510 |
|
|
2648 |
putchar('\n'); |
putchar('\n'); |
2649 |
#if defined(unix) |
#if defined(unix) |
2650 |
} else { |
} else { |
2651 |
(void) signal(SIGINT, SIG_DFL); |
signal(SIGINT, SIG_DFL); |
2652 |
(void) signal(SIGQUIT, SIG_DFL); |
signal(SIGQUIT, SIG_DFL); |
2653 |
#endif /* defined(unix) */ |
#endif /* defined(unix) */ |
2654 |
} |
} |
2655 |
for (;;) { |
for (;;) { |
2672 |
printf("%s> ", prompt); |
printf("%s> ", prompt); |
2673 |
if (fgets(line, sizeof(line), stdin) == NULL) { |
if (fgets(line, sizeof(line), stdin) == NULL) { |
2674 |
if (feof(stdin) || ferror(stdin)) { |
if (feof(stdin) || ferror(stdin)) { |
2675 |
(void) quit(); |
quit(); |
2676 |
/*NOTREACHED*/ |
/*NOTREACHED*/ |
2677 |
} |
} |
2678 |
break; |
break; |