head 1.5; access; symbols pkgsrc-2026Q1:1.5.0.94 pkgsrc-2026Q1-base:1.5 pkgsrc-2025Q4:1.5.0.92 pkgsrc-2025Q4-base:1.5 pkgsrc-2025Q3:1.5.0.90 pkgsrc-2025Q3-base:1.5 pkgsrc-2025Q2:1.5.0.88 pkgsrc-2025Q2-base:1.5 pkgsrc-2025Q1:1.5.0.86 pkgsrc-2025Q1-base:1.5 pkgsrc-2024Q4:1.5.0.84 pkgsrc-2024Q4-base:1.5 pkgsrc-2024Q3:1.5.0.82 pkgsrc-2024Q3-base:1.5 pkgsrc-2024Q2:1.5.0.80 pkgsrc-2024Q2-base:1.5 pkgsrc-2024Q1:1.5.0.78 pkgsrc-2024Q1-base:1.5 pkgsrc-2023Q4:1.5.0.76 pkgsrc-2023Q4-base:1.5 pkgsrc-2023Q3:1.5.0.74 pkgsrc-2023Q3-base:1.5 pkgsrc-2023Q2:1.5.0.72 pkgsrc-2023Q2-base:1.5 pkgsrc-2023Q1:1.5.0.70 pkgsrc-2023Q1-base:1.5 pkgsrc-2022Q4:1.5.0.68 pkgsrc-2022Q4-base:1.5 pkgsrc-2022Q3:1.5.0.66 pkgsrc-2022Q3-base:1.5 pkgsrc-2022Q2:1.5.0.64 pkgsrc-2022Q2-base:1.5 pkgsrc-2022Q1:1.5.0.62 pkgsrc-2022Q1-base:1.5 pkgsrc-2021Q4:1.5.0.60 pkgsrc-2021Q4-base:1.5 pkgsrc-2021Q3:1.5.0.58 pkgsrc-2021Q3-base:1.5 pkgsrc-2021Q2:1.5.0.56 pkgsrc-2021Q2-base:1.5 pkgsrc-2021Q1:1.5.0.54 pkgsrc-2021Q1-base:1.5 pkgsrc-2020Q4:1.5.0.52 pkgsrc-2020Q4-base:1.5 pkgsrc-2020Q3:1.5.0.50 pkgsrc-2020Q3-base:1.5 pkgsrc-2020Q2:1.5.0.46 pkgsrc-2020Q2-base:1.5 pkgsrc-2020Q1:1.5.0.26 pkgsrc-2020Q1-base:1.5 pkgsrc-2019Q4:1.5.0.48 pkgsrc-2019Q4-base:1.5 pkgsrc-2019Q3:1.5.0.44 pkgsrc-2019Q3-base:1.5 pkgsrc-2019Q2:1.5.0.42 pkgsrc-2019Q2-base:1.5 pkgsrc-2019Q1:1.5.0.40 pkgsrc-2019Q1-base:1.5 pkgsrc-2018Q4:1.5.0.38 pkgsrc-2018Q4-base:1.5 pkgsrc-2018Q3:1.5.0.36 pkgsrc-2018Q3-base:1.5 pkgsrc-2018Q2:1.5.0.34 pkgsrc-2018Q2-base:1.5 pkgsrc-2018Q1:1.5.0.32 pkgsrc-2018Q1-base:1.5 pkgsrc-2017Q4:1.5.0.30 pkgsrc-2017Q4-base:1.5 pkgsrc-2017Q3:1.5.0.28 pkgsrc-2017Q3-base:1.5 pkgsrc-2017Q2:1.5.0.24 pkgsrc-2017Q2-base:1.5 pkgsrc-2017Q1:1.5.0.22 pkgsrc-2017Q1-base:1.5 pkgsrc-2016Q4:1.5.0.20 pkgsrc-2016Q4-base:1.5 pkgsrc-2016Q3:1.5.0.18 pkgsrc-2016Q3-base:1.5 pkgsrc-2016Q2:1.5.0.16 pkgsrc-2016Q2-base:1.5 pkgsrc-2016Q1:1.5.0.14 pkgsrc-2016Q1-base:1.5 pkgsrc-2015Q4:1.5.0.12 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.10 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.8 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.6 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.5.0.4 pkgsrc-2014Q4-base:1.5 pkgsrc-2014Q3:1.5.0.2 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.4.0.6 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.4 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.2 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.3.0.6 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.4 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.2 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.2.0.62 pkgsrc-2012Q4-base:1.2 pkgsrc-2012Q3:1.2.0.60 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.58 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.2.0.56 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.54 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.2.0.52 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.50 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.48 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.46 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.44 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.2.0.42 pkgsrc-2010Q2-base:1.2 pkgsrc-2010Q1:1.2.0.40 pkgsrc-2010Q1-base:1.2 pkgsrc-2009Q4:1.2.0.38 pkgsrc-2009Q4-base:1.2 pkgsrc-2009Q3:1.2.0.36 pkgsrc-2009Q3-base:1.2 pkgsrc-2009Q2:1.2.0.34 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.32 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.2.0.30 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.28 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.26 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.24 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.22 pkgsrc-2008Q1:1.2.0.20 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.18 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.16 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.14 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.12 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.10 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.8 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.6 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.4 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.2 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.1.0.24 pkgsrc-2005Q3-base:1.1 pkgsrc-2005Q2:1.1.0.22 pkgsrc-2005Q2-base:1.1 pkgsrc-2005Q1:1.1.0.20 pkgsrc-2005Q1-base:1.1 pkgsrc-2004Q4:1.1.0.18 pkgsrc-2004Q4-base:1.1 pkgsrc-2004Q3:1.1.0.16 pkgsrc-2004Q3-base:1.1 pkgsrc-2004Q2:1.1.0.14 pkgsrc-2004Q2-base:1.1 pkgsrc-2004Q1:1.1.0.12 pkgsrc-2004Q1-base:1.1 pkgsrc-2003Q4:1.1.0.10 pkgsrc-2003Q4-base:1.1 netbsd-1-6-1:1.1.0.6 netbsd-1-6-1-base:1.1 netbsd-1-6:1.1.0.8 netbsd-1-6-RELEASE-base:1.1 pkgviews:1.1.0.4 pkgviews-base:1.1 buildlink2:1.1.0.2 buildlink2-base:1.1 netbsd-1-5-PATCH003:1.1 netbsd-1-5-PATCH001:1.1; locks; strict; comment @# @; 1.5 date 2014.09.22.11.56.39; author joerg; state Exp; branches; next 1.4; commitid crrpKS4aSJVHTkRx; 1.4 date 2013.11.24.05.53.52; author dholland; state Exp; branches; next 1.3; commitid r3qZaH481cnZAuex; 1.3 date 2013.02.26.10.20.17; author joerg; state Exp; branches; next 1.2; 1.2 date 2005.12.04.01.10.33; author joerg; state Exp; branches; next 1.1; 1.1 date 2001.05.03.18.37.49; author fredb; state Exp; branches; next ; desc @@ 1.5 log @Fix implicit prototype conflicts. Always include termios.h for ECHO. @ text @$NetBSD: patch-ae,v 1.4 2013/11/24 05:53:52 dholland Exp $ - avoid union wait - force termios on all modern systems - declare void functions void - avoid implicit int - don't declare own errno - fix os conditionals (apparently with respect to VMS) - call execl() and execlp() correctly - don't synthesize vsprintf with fake arguments - use ctype.h functions correctly --- main.c.orig 2002-01-09 00:41:11.000000000 +0000 +++ main.c @@@@ -63,15 +63,7 @@@@ SOFTWARE. #include #include #include -#ifdef linux -#ifdef __GLIBC__ -#if __GLIBC_MINOR__<1 -#include -#else #include -#endif /* __GLIBC_MINOR__ */ -#endif /* __GLIBC__ */ -#endif #ifdef DGUX /* dkim@@surecom.com */ /* DGUX is SVR4 but its SYSV side of TTY has bugs in it */ @@@@ -239,8 +231,18 @@@@ static Bool IsPts = False; #ifdef SVR4 #define USE_POSIX_WAIT #endif +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ + defined(__DragonFly__) || defined(__linux__) +#ifndef USE_POSIX_WAIT +#define USE_POSIX_WAIT +#endif +#ifndef USE_TERMIOS +#define USE_TERMIOS +#endif +#endif #include +#include #include #include @@@@ -391,6 +393,9 @@@@ extern char *ptsname(); extern char *strindex (); extern void HandlePopupMenu(); +static void get_terminal (void); +static void resize(TScreen *screen, char *TermName, char *oldtc, char *newtc); + int switchfb[] = {0, 2, 1, 3}; static SIGNAL_T reapchild (); @@@@ -583,6 +588,8 @@@@ static int tslot; #endif /* USE_SYSV_UTMP */ static jmp_buf env; +static void spawn (void); + char *ProgramName; Boolean sunFunctionKeys; @@@@ -805,9 +812,9 @@@@ static char *message[] = { "will be started. Options that start with a plus sign (+) restore the default.", NULL}; -#ifndef USE_TERMIOS -static remove_termcap_entry (); -#endif +/*#ifndef USE_TERMIOS*/ +static void remove_termcap_entry (char *, const char *); +/*#endif*/ static int abbrev (tst, cmp) char *tst, *cmp; @@@@ -816,7 +823,7 @@@@ static int abbrev (tst, cmp) return ((len >= 2) && (!strncmp(tst, cmp, len))); } -static Syntax (badOption) +static void Syntax (badOption) char *badOption; { struct _options *opt; @@@@ -842,13 +849,13 @@@@ static Syntax (badOption) exit (1); } -static Version () +static void Version () { printf("%s %s %s %s\n", HANTERM_PRODUCT, HANTERM_VERSION, HANTERM_RELEASE, HANTERM_RELEASEDATE); exit (0); } -static Help () +static void Help () { struct _options *opt; char **cpp; @@@@ -960,6 +967,7 @@@@ XtActionsRec actionProcs[] = { Atom wm_delete_window; +int main (argc, argv) int argc; char **argv; @@@@ -1527,7 +1535,8 @@@@ char **argv; if (ioctl (pty, FIONBIO, (char *)&mode) == -1) SysError (ERROR_FIONBIO); #endif /* USE_SYSV_TERMIO */ -#if defined(linux)||defined(SVR4)||(defined(hpux)&&OSMAJORVERSION>=10) + +#ifndef VMS pty_mask = pty; X_mask = Xsocket; FD_ZERO(&Select_mask); @@@@ -1566,6 +1575,7 @@@@ char *name; * has problems, we can re-enter this function and get another one. */ +int get_pty (pty) int *pty; { @@@@ -1730,6 +1740,7 @@@@ int pty_search(pty) return 1; } +static void get_terminal () /* * sets up X and initializes the terminal structure except for term.buf.fildes. @@@@ -1854,7 +1865,7 @@@@ void first_map_occurred () #endif /* USE_HANDSHAKE else !USE_HANDSHAKE */ -spawn () +static void spawn (void) /* * Inits pty and tty and forks a login process. * Does not close fd Xsocket. @@@@ -2983,10 +2994,10 @@@@ spawn () #ifdef USE_LOGIN_DASH_P if (term->misc.login_shell && pw && added_utmp_entry) - execl (bin_login, "login", "-p", "-f", pw->pw_name, 0); + execl (bin_login, "login", "-p", "-f", pw->pw_name, (void *)NULL); #endif execlp (ptr, (term->misc.login_shell ? shname_minus : shname), - 0); + (void *)NULL); /* Exec failed. */ fprintf (stderr, "%s: Could not exec %s!\n", xterm_name, ptr); @@@@ -3235,10 +3246,8 @@@@ Exit(n) } /* ARGSUSED */ -resize(screen, TermName, oldtc, newtc) -TScreen *screen; -char *TermName; -register char *oldtc, *newtc; +static void +resize(TScreen *screen, char *TermName, char *oldtc, char *newtc) { #ifndef USE_SYSV_ENVVARS register char *ptr1, *ptr2; @@@@ -3329,18 +3338,20 @@@@ static SIGNAL_T reapchild (n) } /* VARARGS1 */ -consolepr(fmt,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9) -char *fmt; +void +consolepr(const char *fmt, ...) { - extern int errno; extern char *SysErrorMsg(); int oerrno; int f; char buf[ BUFSIZ ]; + va_list ap; oerrno = errno; strcpy(buf, "hanterm: "); - sprintf(buf+strlen(buf), fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9); + va_start(ap, fmt); + vsnprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), fmt, ap); + va_end(ap); strcat(buf, ": "); strcat(buf, SysErrorMsg (oerrno)); strcat(buf, "\n"); @@@@ -3356,10 +3367,8 @@@@ char *fmt; } -#ifndef USE_TERMIOS -static remove_termcap_entry (buf, str) - char *buf; - char *str; +/*#ifndef USE_TERMIOS*/ +static void remove_termcap_entry (char *buf, const char *str) { register char *strinbuf; @@@@ -3377,7 +3386,7 @@@@ static remove_termcap_entry (buf, str) } return; } -#endif +/*#endif*/ /* * parse_tty_modes accepts lines of the following form: @@@@ -3396,7 +3405,8 @@@@ static int parse_tty_modes (s, modelist) int count = 0; while (1) { - while (*s && isascii(*s) && isspace(*s)) s++; + while (*s && isascii((unsigned char)*s) && isspace((unsigned char)*s)) + s++; if (!*s) return count; for (mp = modelist; mp->name; mp++) { @ 1.4 log @Use C89. Always use mkstemp(). PKGREVISION -> 6. @ text @d1 1 a1 1 $NetBSD: patch-ae,v 1.3 2013/02/26 10:20:17 joerg Exp $ d15 17 a31 1 @@@@ -239,8 +239,18 @@@@ static Bool IsPts = False; d50 11 a60 1 @@@@ -583,6 +593,8 @@@@ static int tslot; d69 1 a69 1 @@@@ -805,9 +817,9 @@@@ static char *message[] = { d82 1 a82 1 @@@@ -816,7 +828,7 @@@@ static int abbrev (tst, cmp) d91 1 a91 1 @@@@ -842,13 +854,13 @@@@ static Syntax (badOption) d107 1 a107 1 @@@@ -960,6 +972,7 @@@@ XtActionsRec actionProcs[] = { d115 1 a115 1 @@@@ -1527,7 +1540,8 @@@@ char **argv; d125 1 a125 1 @@@@ -1566,6 +1580,7 @@@@ char *name; d133 1 a133 1 @@@@ -1730,6 +1745,7 @@@@ int pty_search(pty) d137 1 a137 1 +void d141 1 a141 1 @@@@ -1854,7 +1870,7 @@@@ void first_map_occurred () d150 1 a150 1 @@@@ -2983,10 +2999,10 @@@@ spawn () d163 1 a163 1 @@@@ -3235,6 +3251,7 @@@@ Exit(n) d167 10 a176 5 +void resize(screen, TermName, oldtc, newtc) TScreen *screen; char *TermName; @@@@ -3329,18 +3346,20 @@@@ static SIGNAL_T reapchild (n) d201 1 a201 1 @@@@ -3356,10 +3375,8 @@@@ char *fmt; d214 1 a214 1 @@@@ -3377,7 +3394,7 @@@@ static remove_termcap_entry (buf, str) d223 1 a223 1 @@@@ -3396,7 +3413,8 @@@@ static int parse_tty_modes (s, modelist) @ 1.3 log @Fix return types. @ text @d1 11 a11 1 $NetBSD: patch-ae,v 1.2 2005/12/04 01:10:33 joerg Exp $ d15 20 a34 1 @@@@ -583,6 +583,8 @@@@ static int tslot; d43 2 a44 1 @@@@ -806,7 +808,7 @@@@ static char *message[] = { d47 1 a47 1 #ifndef USE_TERMIOS d49 2 d52 1 a52 1 #endif d55 35 a89 1 @@@@ -1527,7 +1529,8 @@@@ char **argv; d99 17 a115 1 @@@@ -1854,7 +1857,7 @@@@ void first_map_occurred () d124 29 a152 3 @@@@ -3332,7 +3335,6 @@@@ static SIGNAL_T reapchild (n) consolepr(fmt,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9) char *fmt; d158 14 a171 1 @@@@ -3357,9 +3359,7 @@@@ char *fmt; d174 1 a174 1 #ifndef USE_TERMIOS d178 1 d183 19 @ 1.2 log @DragonFly and errno fixes. @ text @d1 1 a1 1 $NetBSD$ d5 19 a23 1 @@@@ -1527,7 +1527,8 @@@@ char **argv; d33 10 a42 1 @@@@ -3332,7 +3333,6 @@@@ static SIGNAL_T reapchild (n) d50 11 @ 1.1 log @Use the FD_* macros with select(). Take a clue from XFree-3.3.6 xterm, and make this conditional on only "#ifndef VMS". @ text @d3 1 a3 1 --- main.c.orig Tue Nov 28 04:44:05 2000 d5 1 a5 1 @@@@ -1508,7 +1508,8 @@@@ d15 8 @