- printf("%s too long\r\n", err);
- exit(1);
- }
- *buf++ = c;
- } while (c != 0);
-}
-
-char *speeds[] =
- { "0", "50", "75", "110", "134", "150", "200", "300",
- "600", "1200", "1800", "2400", "4800", "9600", "19200", "38400" };
-#define NSPEEDS (sizeof (speeds) / sizeof (speeds[0]))
-
-doremoteterm(term, tp)
- char *term;
- struct sgttyb *tp;
-{
- register char *cp = index(term, '/'), **cpp;
- char *speed;
-
- if (cp) {
- *cp++ = '\0';
- speed = cp;
- cp = index(speed, '/');
- if (cp)
- *cp++ = '\0';
- for (cpp = speeds; cpp < &speeds[NSPEEDS]; cpp++)
- if (strcmp(*cpp, speed) == 0) {
- tp->sg_ispeed = tp->sg_ospeed = cpp-speeds;
- break;
- }
- }
- tp->sg_flags = ECHO|CRMOD|ANYP|XTABS;
-}
-
-/*
- * Set the value of var to be arg in the Unix 4.2 BSD environment env.
- * Var should end with '='.
- * (bindings are of the form "var=value")
- * This procedure assumes the memory for the first level of environ
- * was allocated using malloc.
- */
-setenv(var, value, clobber)
- char *var, *value;
-{
- extern char **environ;
- int index = 0;
- int varlen = strlen(var);
- int vallen = strlen(value);
-
- for (index = 0; environ[index] != NULL; index++) {
- if (strncmp(environ[index], var, varlen) == 0) {
- /* found it */
- if (!clobber)
- return;
- environ[index] = malloc(varlen + vallen + 1);
- strcpy(environ[index], var);
- strcat(environ[index], value);
- return;