+ if (Sflag) {
+ (void)printf("%s ", ttype);
+ wrtermcap(tcapbuf);
+ }
+
+ if (sflag) {
+ /*
+ * Figure out what shell we're using. A hack, we look for an
+ * environmental variable SHELL ending in "csh".
+ */
+ if ((p = getenv("SHELL")) &&
+ !strcmp(p + strlen(p) - 3, "csh")) {
+ p = "set noglob;\nsetenv TERM %s;\nsetenv TERMCAP '";
+ t = "';\nunset noglob;\n";
+ } else {
+ p = "TERM=%s;\nTERMCAP='";
+ t = "';\nexport TERMCAP TERM;\n";
+ }
+ (void)printf(p, ttype);
+ wrtermcap(tcapbuf);
+ (void)printf(t);
+ }