/****************************************************************************
- * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <dump_entry.h>
#include <transform.h>
-MODULE_ID("$Id: tset.c,v 0.53 2002/08/24 23:18:16 tom Exp $")
+MODULE_ID("$Id: tset.c,v 0.56 2003/12/06 17:21:01 tom Exp $")
extern char **environ;
SET_TTY(STDERR_FILENO, &original);
(void) fprintf(stderr, "\n");
fflush(stderr);
- exit(EXIT_FAILURE);
+ ExitProgram(EXIT_FAILURE);
/* NOTREACHED */
}
char *base = 0;
copy = strdup(arg);
- mapp = malloc(sizeof(MAP));
+ mapp = (MAP *) malloc(sizeof(MAP));
if (copy == 0 || mapp == 0)
failed("malloc");
mapp->next = 0;
**************************************************************************/
/* some BSD systems have these built in, some systems are missing
- * one or more definitions. The safest solution is to override.
+ * one or more definitions. The safest solution is to override unless the
+ * commonly-altered ones are defined.
*/
+#if !(defined(CERASE) && defined(CINTR) && defined(CKILL) && defined(CQUIT))
#undef CEOF
#undef CERASE
#undef CINTR
#undef CSTART
#undef CSTOP
#undef CSUSP
+#endif
/* control-character defaults */
+#ifndef CEOF
#define CEOF CTRL('D')
+#endif
+#ifndef CERASE
#define CERASE CTRL('H')
+#endif
+#ifndef CINTR
#define CINTR 127 /* ^? */
+#endif
+#ifndef CKILL
#define CKILL CTRL('U')
+#endif
+#ifndef CLNEXT
#define CLNEXT CTRL('v')
+#endif
+#ifndef CRPRNT
#define CRPRNT CTRL('r')
+#endif
+#ifndef CQUIT
#define CQUIT CTRL('\\')
+#endif
+#ifndef CSTART
#define CSTART CTRL('Q')
+#endif
+#ifndef CSTOP
#define CSTOP CTRL('S')
+#endif
+#ifndef CSUSP
#define CSUSP CTRL('Z')
+#endif
#define CHK(val, dft) ((int)val <= 0 ? dft : val)
#ifdef TERMIOS
if (!quiet) {
report("Erase", VERASE, CERASE);
- report("Kill", VKILL, CINTR);
- report("Interrupt", VINTR, CKILL);
+ report("Kill", VKILL, CKILL);
+ report("Interrupt", VINTR, CINTR);
}
#endif
}
err("The -S option is not supported under terminfo.");
if (sflag) {
+ int len;
/*
* Figure out what shell we're using. A hack, we look for an
* environmental variable SHELL ending in "csh".
*/
if ((p = getenv("SHELL")) != 0
- && !strcmp(p + strlen(p) - 3, "csh"))
+ && (len = strlen(p)) >= 3
+ && !strcmp(p + len - 3, "csh"))
p = "set noglob;\nsetenv TERM %s;\nunset noglob;\n";
else
p = "TERM=%s;\n";
return EXIT_SUCCESS;
}
-
-/* tset.c ends here */