summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
02b1a26)
SCCS-vsn: usr.bin/tip/tip.h 4.2
SCCS-vsn: usr.bin/tip/vars.c 4.2
SCCS-vsn: usr.bin/tip/cmds.c 4.3
-/* cmds.c 4.2 81/05/31 */
+/* cmds.c 4.3 81/06/02 */
#include "tip.h"
/*
* tip
#include "tip.h"
/*
* tip
return;
}
transmit(fd, value(EOFWRITE), NULL);
return;
}
transmit(fd, value(EOFWRITE), NULL);
+ if (!boolean(value(ECHOCHECK))) {
+ struct sgttyb buf;
+
+ ioctl(FD, TIOCGETP, &buf); /* this does a */
+ ioctl(FD, TIOCSETP, &buf); /* wflushtty */
+ }
if (command != NULL) {
for (pc = command; *pc; pc++)
send(*pc);
if (command != NULL) {
for (pc = command; *pc; pc++)
send(*pc);
- read(FD, (char *)&c, 1); /* trailing \n */
+ if (boolean(value(ECHOCHECK)))
+ read(FD, (char *)&c, 1); /* trailing \n */
+ else {
+ struct sgttyb buf;
+
+ ioctl(FD, TIOCGETP, &buf); /* this does a */
+ ioctl(FD, TIOCSETP, &buf); /* wflushtty */
+ sleep(5); /* wait for remote stty to take effect */
+ }
}
lcount = 0;
lastc = '\0';
}
lcount = 0;
lastc = '\0';
} while (c != '\r');
if (boolean(value(VERBOSE)))
printf("\r%d", ++lcount);
} while (c != '\r');
if (boolean(value(VERBOSE)))
printf("\r%d", ++lcount);
- alarm(10);
- timedout = 0;
- do { /* wait for prompt */
- read(FD, (char *)&c, 1);
- if (timedout || stop) {
- if (timedout)
- printf("\r\ntimed out at eol\r\n");
- alarm(0);
- goto out;
- }
- } while ((c&0177) != character(value(PROMPT)));
- alarm(0);
+ if (boolean(value(ECHOCHECK))) {
+ alarm(10);
+ timedout = 0;
+ do { /* wait for prompt */
+ read(FD, (char *)&c, 1);
+ if (timedout || stop) {
+ if (timedout)
+ printf("\r\ntimed out at eol\r\n");
+ alarm(0);
+ goto out;
+ }
+ } while ((c&0177) != character(value(PROMPT)));
+ alarm(0);
+ }
}
out:
if (lastc != '\n')
}
out:
if (lastc != '\n')
printf("%s: cannot open\r\n", argv[0]);
return;
}
printf("%s: cannot open\r\n", argv[0]);
return;
}
- sprintf(line, "cat>'%s'\r", argv[1]);
+ if (boolean(value(ECHOCHECK)))
+ sprintf(line, "cat>'%s'\r", argv[1]);
+ else
+ sprintf(line, "stty -echo;cat>'%s';stty echo\r", argv[1]);
transmit(fd, "\04", line);
}
transmit(fd, "\04", line);
}
cc = c;
write(FD, (char *)&cc, 1);
cc = c;
write(FD, (char *)&cc, 1);
+ if (!boolean(value(ECHOCHECK)))
+ return;
tryagain:
timedout = 0;
alarm(10);
tryagain:
timedout = 0;
alarm(10);
-/* tip.h 4.1 81/05/09 */
+/* tip.h 4.2 81/06/02 */
/*
* tip - terminal interface program
*
/*
* tip - terminal interface program
*
#define VERBOSE 21
#define SHELL 22
#define HOME 23
#define VERBOSE 21
#define SHELL 22
#define HOME 23
#else
#define PHONES 11
#define PROMPT 12
#else
#define PHONES 11
#define PROMPT 12
#define VERBOSE 19
#define SHELL 20
#define HOME 21
#define VERBOSE 19
#define SHELL 20
#define HOME 21
#endif
#define NOVAL ((value_t *)NULL)
#endif
#define NOVAL ((value_t *)NULL)
-/* vars.c 4.1 81/05/09 */
+/* vars.c 4.2 81/06/02 */
NULL, "/bin/sh" },
{ "HOME", STRING|ENVIRON, (READ|WRITE)<<PUBLIC,
NOSTR, NOSTR },
NULL, "/bin/sh" },
{ "HOME", STRING|ENVIRON, (READ|WRITE)<<PUBLIC,
NOSTR, NOSTR },
+ { "echocheck", BOOL, (READ|WRITE)<<PUBLIC,
+ "ec", (char *)FALSE },
{ NOSTR, NULL, NULL, NOSTR, NOSTR }
};
{ NOSTR, NULL, NULL, NOSTR, NOSTR }
};