Use C89. Always use mkstemp(). PKGREVISION -> 6.
This commit is contained in:
parent
23bc9b63d0
commit
dd2611275c
12 changed files with 539 additions and 44 deletions
|
@ -1,7 +1,7 @@
|
|||
# $NetBSD: Makefile,v 1.24 2012/10/29 05:06:21 asau Exp $
|
||||
# $NetBSD: Makefile,v 1.25 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
DISTNAME= hanterm-3.1.6
|
||||
PKGREVISION= 5
|
||||
PKGREVISION= 6
|
||||
CATEGORIES= x11 korean
|
||||
MASTER_SITES= http://download.kldp.net/hanterm/hanterm/3.1.6/
|
||||
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
$NetBSD: distinfo,v 1.10 2013/02/26 10:20:17 joerg Exp $
|
||||
$NetBSD: distinfo,v 1.11 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
SHA1 (hanterm-3.1.6.tar.gz) = df2ff9ca8ddcee41baeaa8544a9983a1534e8b30
|
||||
RMD160 (hanterm-3.1.6.tar.gz) = 9d9c6c1d2eca9ad338140f1d8c418ed5e0e9548b
|
||||
Size (hanterm-3.1.6.tar.gz) = 323736 bytes
|
||||
SHA1 (patch-aa) = 3f7f1797c5d8425ff146692e9127b2bfe2c21a5f
|
||||
SHA1 (patch-ab) = 8b861979eeffc3e9763f4a2162c0e007c61f1a6c
|
||||
SHA1 (patch-ac) = 4c6b6efc12f2e1fba6eb577c65c94d701574353b
|
||||
SHA1 (patch-ad) = 50d6c38ab197e02a15b73bc7cfea476d22eaf961
|
||||
SHA1 (patch-ae) = 14596ad1ae796679a6fcc9184df95df57f0beba6
|
||||
SHA1 (patch-aa) = 985f6bf88010e8addcaa7f18d70652dcd65255f4
|
||||
SHA1 (patch-ab) = 776a5618e0be40d3bac6d83d707c5dd970f208cf
|
||||
SHA1 (patch-ac) = 4c5a60d1785099abe809acfcd1b6363be81e17f4
|
||||
SHA1 (patch-ad) = 76ab4f52449d9e378884bc9d8e41b249e494fd04
|
||||
SHA1 (patch-ae) = 00c0992dd92832b3819574d4f3856bcf8a0a6e75
|
||||
SHA1 (patch-af) = 7306a141331bbbe1e4ee4e46549834be2ae2cfa1
|
||||
SHA1 (patch-ag) = 50a7a71b7075ac57735189f43fd7e770ec9de81d
|
||||
SHA1 (patch-button.c) = 7a8204422045cf37a468723d85b79bc79d9a7735
|
||||
SHA1 (patch-chat.c) = 4c5162afae53a3c0bff08991648fe1b0cf07b38f
|
||||
SHA1 (patch-screen.c) = 262b4c1dbec28ae5e6fdf6893c41be3b6d3d95b5
|
||||
SHA1 (patch-scrollbar.c) = c7e34150fa6f9efe95777cbf675f2a8ebb8d14f6
|
||||
SHA1 (patch-util.c) = eba8de0714d749809a20334fa3035dfd52648402
|
||||
|
|
|
@ -1,8 +1,21 @@
|
|||
$NetBSD: patch-aa,v 1.6 2013/02/26 10:20:17 joerg Exp $
|
||||
$NetBSD: patch-aa,v 1.7 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use standard headers
|
||||
- build on Dragonfly
|
||||
- always use mkstemp()
|
||||
- declare void functions void
|
||||
- avoid sys_errlist
|
||||
|
||||
--- misc.c.orig 2002-01-09 00:41:11.000000000 +0000
|
||||
+++ misc.c
|
||||
@@ -35,7 +35,7 @@
|
||||
@@ -29,13 +29,14 @@
|
||||
|
||||
#include <X11/Xos.h>
|
||||
#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
#include <pwd.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -11,7 +24,16 @@ $NetBSD: patch-aa,v 1.6 2013/02/26 10:20:17 joerg Exp $
|
|||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
@@ -584,8 +584,7 @@ register TScreen *screen;
|
||||
@@ -498,7 +499,7 @@ register TScreen *screen;
|
||||
free(screen->logfile);
|
||||
if(log_default == NULL)
|
||||
log_default = log_def_name;
|
||||
-#ifdef __linux__
|
||||
+#if 1
|
||||
mkstemp(log_default);
|
||||
#else
|
||||
mktemp(log_default);
|
||||
@@ -584,8 +585,7 @@ register TScreen *screen;
|
||||
update_logging();
|
||||
}
|
||||
|
||||
|
@ -21,11 +43,31 @@ $NetBSD: patch-aa,v 1.6 2013/02/26 10:20:17 joerg Exp $
|
|||
{
|
||||
if(!screen->logging || (screen->inhibit & I_LOG))
|
||||
return;
|
||||
@@ -913,7 +912,6 @@ char *SysErrorMsg (n)
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
#endif
|
||||
- extern int sys_nerr;
|
||||
|
||||
return ((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
|
||||
@@ -897,25 +897,9 @@ int a;
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
-#if defined(linux) && defined(__GLIBC__)
|
||||
-const char *const SysErrorMsg(n)
|
||||
-#else
|
||||
-char *SysErrorMsg (n)
|
||||
-#endif
|
||||
- int n;
|
||||
+const char *const SysErrorMsg(int n)
|
||||
{
|
||||
-#if defined(linux) && defined(__GLIBC__)
|
||||
- extern const char *const sys_errlist[];
|
||||
-#else
|
||||
-#if (defined(BSD) && (BSD >= 199306))
|
||||
- /* in *BSD, should be null because it is already declared */
|
||||
-#else
|
||||
- extern char *sys_errlist[];
|
||||
-#endif
|
||||
-#endif
|
||||
- extern int sys_nerr;
|
||||
-
|
||||
- return ((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
|
||||
+ return strerror(n);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
$NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
||||
$NetBSD: patch-ab,v 1.2 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
--- charproc.c.orig Tue Nov 28 04:44:05 2000
|
||||
- use standard headers
|
||||
- don't provide own malloc/realloc declarations
|
||||
- avoid implicit int
|
||||
- declare void functions void
|
||||
- fix os conditionals (apparently with respect to VMS)
|
||||
- don't cast return value of malloc
|
||||
|
||||
--- charproc.c.orig 2001-06-06 13:05:15.000000000 +0000
|
||||
+++ charproc.c
|
||||
@@ -46,6 +46,8 @@
|
||||
@@ -47,10 +47,13 @@ int eng_descent;
|
||||
#include <X11/Xmu/CharSet.h>
|
||||
#include <X11/Xmu/Converters.h>
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <setjmp.h>
|
||||
#include <ctype.h>
|
||||
#include <X11/keysym.h>
|
||||
|
@ -11,7 +23,25 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
#include "hangul.h"
|
||||
#include "hstrdefs.h"
|
||||
|
||||
@@ -1755,7 +1757,7 @@
|
||||
@@ -81,8 +84,6 @@ extern int font_minus_width_char_byte2;
|
||||
|
||||
extern Widget toplevel;
|
||||
extern void exit();
|
||||
-extern char *malloc();
|
||||
-extern char *realloc();
|
||||
|
||||
extern void FlushScroll();
|
||||
extern void InsertLine();
|
||||
@@ -1764,7 +1765,7 @@ static void VTparse()
|
||||
}
|
||||
}
|
||||
|
||||
-static finput()
|
||||
+static int finput(void)
|
||||
{
|
||||
return(doinput());
|
||||
}
|
||||
@@ -1774,13 +1775,14 @@ static char *v_buffer; /* pointer to ph
|
||||
static char *v_bufstr = NULL; /* beginning of area to write */
|
||||
static char *v_bufptr; /* end of area to write */
|
||||
static char *v_bufend; /* end of physical buffer */
|
||||
|
@ -20,7 +50,14 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
#define ptymask() (v_bufptr > v_bufstr ? pty_mask : 0)
|
||||
#endif
|
||||
|
||||
@@ -1783,7 +1785,7 @@
|
||||
/* Write data to the pty as typed by the user, pasted with the mouse,
|
||||
or generated by us in response to a query ESC sequence. */
|
||||
|
||||
+int
|
||||
v_write(f, d, len)
|
||||
int f;
|
||||
char *d;
|
||||
@@ -1802,7 +1804,7 @@ v_write(f, d, len)
|
||||
fprintf(stderr, "\n");
|
||||
#endif
|
||||
|
||||
|
@ -29,7 +66,7 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
if (f != pty_mask)
|
||||
#else
|
||||
if ((1 << f) != pty_mask)
|
||||
@@ -1908,7 +1910,7 @@
|
||||
@@ -1927,7 +1929,7 @@ v_write(f, d, len)
|
||||
return(c);
|
||||
}
|
||||
|
||||
|
@ -38,7 +75,15 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
static fd_set select_mask;
|
||||
static fd_set write_mask;
|
||||
#else
|
||||
@@ -1924,7 +1926,7 @@
|
||||
@@ -1936,6 +1938,7 @@ static int write_mask;
|
||||
#endif
|
||||
static int pty_read_bytes;
|
||||
|
||||
+int
|
||||
in_put()
|
||||
{
|
||||
register TScreen *screen = &term->screen;
|
||||
@@ -1943,7 +1946,7 @@ in_put()
|
||||
static struct timeval select_timeout;
|
||||
|
||||
for( ; ; ) {
|
||||
|
@ -47,7 +92,7 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
if (FD_ISSET(pty_mask, &select_mask) && eventMode == NORMAL) {
|
||||
#else
|
||||
if (select_mask & pty_mask && eventMode == NORMAL) {
|
||||
@@ -1984,7 +1986,7 @@
|
||||
@@ -2003,7 +2006,7 @@ in_put()
|
||||
/* stop speed reading at some point to look for X stuff */
|
||||
/* (4096 is just a random large number.) */
|
||||
if (pty_read_bytes > 4096) {
|
||||
|
@ -56,7 +101,7 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
FD_CLR(pty_mask, &select_mask);
|
||||
#else
|
||||
select_mask &= ~pty_mask;
|
||||
@@ -2014,7 +2016,7 @@
|
||||
@@ -2033,7 +2036,7 @@ in_put()
|
||||
/* Update the masks and, unless X events are already in the queue,
|
||||
wait for I/O to be possible. */
|
||||
select_mask = Select_mask;
|
||||
|
@ -65,7 +110,7 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
if (v_bufptr > v_bufstr)
|
||||
FD_SET(pty_mask, &write_mask);
|
||||
else
|
||||
@@ -2028,7 +2030,7 @@
|
||||
@@ -2047,7 +2050,7 @@ in_put()
|
||||
/* by sangil's report */
|
||||
/* #if defined(linux)||defined(SVR4)
|
||||
||(defined(hpux) && OSMAJORVERSION >= 10) */
|
||||
|
@ -74,7 +119,7 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
if (QLength (screen->display))
|
||||
{
|
||||
i = select(max_plus1, (fd_set*) &select_mask, (fd_set*) &write_mask, (fd_set *)NULL, (struct timeval *) &select_timeout);
|
||||
@@ -2054,7 +2056,7 @@
|
||||
@@ -2073,7 +2076,7 @@ in_put()
|
||||
}
|
||||
|
||||
/* if there is room to write more data to the pty, go write more */
|
||||
|
@ -83,7 +128,7 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
if ((v_bufptr > v_bufstr) && FD_ISSET(pty_mask, &write_mask)) {
|
||||
#else
|
||||
if (write_mask & ptymask()) {
|
||||
@@ -2064,7 +2066,7 @@
|
||||
@@ -2083,7 +2086,7 @@ in_put()
|
||||
|
||||
/* if there are X events already in our queue, it
|
||||
counts as being readable */
|
||||
|
@ -92,3 +137,85 @@ $NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
|||
if (QLength(screen->display) || (FD_ISSET(X_mask, &select_mask))) {
|
||||
#else
|
||||
if (QLength(screen->display) || (select_mask & X_mask)) {
|
||||
@@ -2322,6 +2325,7 @@ WriteText(screen, str, len, flags, fg, b
|
||||
/*
|
||||
* process ANSI modes set, reset
|
||||
*/
|
||||
+void
|
||||
ansi_modes(termw, func)
|
||||
XtermWidget termw;
|
||||
int (*func)();
|
||||
@@ -2345,6 +2349,7 @@ ansi_modes(termw, func)
|
||||
/*
|
||||
* process DEC private modes set, reset
|
||||
*/
|
||||
+void
|
||||
dpmodes(termw, func)
|
||||
XtermWidget termw;
|
||||
void (*func)();
|
||||
@@ -2498,6 +2503,7 @@ dpmodes(termw, func)
|
||||
/*
|
||||
* process xterm private modes save
|
||||
*/
|
||||
+void
|
||||
savemodes(termw)
|
||||
XtermWidget termw;
|
||||
{
|
||||
@@ -2564,6 +2570,7 @@ savemodes(termw)
|
||||
/*
|
||||
* process xterm private modes restore
|
||||
*/
|
||||
+void
|
||||
restoremodes(termw)
|
||||
XtermWidget termw;
|
||||
{
|
||||
@@ -2711,6 +2718,7 @@ static void bitclr(p, mask)
|
||||
*p &= ~mask;
|
||||
}
|
||||
|
||||
+void
|
||||
unparseseq(ap, fd)
|
||||
register ANSI *ap;
|
||||
int fd;
|
||||
@@ -2744,6 +2752,7 @@ unparseseq(ap, fd)
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
unparseputn(n, fd)
|
||||
unsigned int n;
|
||||
int fd;
|
||||
@@ -2756,6 +2765,7 @@ int fd;
|
||||
unparseputc((char) ('0' + (n%10)), fd);
|
||||
}
|
||||
|
||||
+void
|
||||
unparseputc(c, fd)
|
||||
int c;
|
||||
int fd;
|
||||
@@ -2774,6 +2784,7 @@ int fd;
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
unparsefputs (s, fd)
|
||||
register char *s;
|
||||
int fd;
|
||||
@@ -4062,7 +4073,7 @@ int LoadNewFont (screen, nfontname, bfon
|
||||
|
||||
if (fontnum == fontMenu_fontescape &&
|
||||
nfontname != screen->menu_font_names[fontnum]) {
|
||||
- tmpname = (char *) malloc (strlen(nfontname) + 1);
|
||||
+ tmpname = malloc (strlen(nfontname) + 1);
|
||||
if (!tmpname) return 0;
|
||||
strcpy (tmpname, nfontname);
|
||||
}
|
||||
@@ -4377,7 +4388,7 @@ set_vt_graphics (screen)
|
||||
static char gr_valid_code[] = " `ajklmnopqrstuvwx~";
|
||||
|
||||
if (!gr_mapping) {
|
||||
- gr_mapping = (int *)malloc(sizeof(int)*256);
|
||||
+ gr_mapping = malloc(sizeof(int)*256);
|
||||
for(i = 0; i < 256; i++) {
|
||||
gr_mapping[i] = 1;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
$NetBSD: patch-ac,v 1.1 2001/05/03 18:37:48 fredb Exp $
|
||||
$NetBSD: patch-ac,v 1.2 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use (semi-)standard headers
|
||||
- fix os conditionals (apparently with respect to VMS)
|
||||
|
||||
--- data.c.orig Wed Feb 24 05:04:50 1999
|
||||
+++ data.c
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
$NetBSD: patch-ad,v 1.2 2005/12/04 01:10:33 joerg Exp $
|
||||
$NetBSD: patch-ad,v 1.3 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use (semi-)standard headers
|
||||
- fix os conditionals (apparently with respect to VMS)
|
||||
- don't declare own errno
|
||||
|
||||
--- data.h.orig 1999-02-24 11:04:50.000000000 +0000
|
||||
+++ data.h
|
||||
|
|
|
@ -1,8 +1,37 @@
|
|||
$NetBSD: patch-ae,v 1.3 2013/02/26 10:20:17 joerg Exp $
|
||||
$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
|
||||
@@ -583,6 +583,8 @@ static int tslot;
|
||||
@@ -239,8 +239,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 <stdio.h>
|
||||
+#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
@@ -583,6 +593,8 @@ static int tslot;
|
||||
#endif /* USE_SYSV_UTMP */
|
||||
static jmp_buf env;
|
||||
|
||||
|
@ -11,16 +40,53 @@ $NetBSD: patch-ae,v 1.3 2013/02/26 10:20:17 joerg Exp $
|
|||
char *ProgramName;
|
||||
Boolean sunFunctionKeys;
|
||||
|
||||
@@ -806,7 +808,7 @@ static char *message[] = {
|
||||
@@ -805,9 +817,9 @@ static char *message[] = {
|
||||
"will be started. Options that start with a plus sign (+) restore the default.",
|
||||
NULL};
|
||||
|
||||
#ifndef USE_TERMIOS
|
||||
-#ifndef USE_TERMIOS
|
||||
-static remove_termcap_entry ();
|
||||
-#endif
|
||||
+/*#ifndef USE_TERMIOS*/
|
||||
+static void remove_termcap_entry (char *, const char *);
|
||||
#endif
|
||||
+/*#endif*/
|
||||
|
||||
static int abbrev (tst, cmp)
|
||||
@@ -1527,7 +1529,8 @@ char **argv;
|
||||
char *tst, *cmp;
|
||||
@@ -816,7 +828,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 +854,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 +972,7 @@ XtActionsRec actionProcs[] = {
|
||||
|
||||
Atom wm_delete_window;
|
||||
|
||||
+int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
@@ -1527,7 +1540,8 @@ char **argv;
|
||||
if (ioctl (pty, FIONBIO, (char *)&mode) == -1) SysError (ERROR_FIONBIO);
|
||||
#endif /* USE_SYSV_TERMIO */
|
||||
|
||||
|
@ -30,7 +96,23 @@ $NetBSD: patch-ae,v 1.3 2013/02/26 10:20:17 joerg Exp $
|
|||
pty_mask = pty;
|
||||
X_mask = Xsocket;
|
||||
FD_ZERO(&Select_mask);
|
||||
@@ -1854,7 +1857,7 @@ void first_map_occurred ()
|
||||
@@ -1566,6 +1580,7 @@ char *name;
|
||||
* has problems, we can re-enter this function and get another one.
|
||||
*/
|
||||
|
||||
+int
|
||||
get_pty (pty)
|
||||
int *pty;
|
||||
{
|
||||
@@ -1730,6 +1745,7 @@ int pty_search(pty)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+void
|
||||
get_terminal ()
|
||||
/*
|
||||
* sets up X and initializes the terminal structure except for term.buf.fildes.
|
||||
@@ -1854,7 +1870,7 @@ void first_map_occurred ()
|
||||
#endif /* USE_HANDSHAKE else !USE_HANDSHAKE */
|
||||
|
||||
|
||||
|
@ -39,22 +121,81 @@ $NetBSD: patch-ae,v 1.3 2013/02/26 10:20:17 joerg Exp $
|
|||
/*
|
||||
* Inits pty and tty and forks a login process.
|
||||
* Does not close fd Xsocket.
|
||||
@@ -3332,7 +3335,6 @@ static SIGNAL_T reapchild (n)
|
||||
consolepr(fmt,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
|
||||
char *fmt;
|
||||
@@ -2983,10 +2999,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,6 +3251,7 @@ Exit(n)
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
+void
|
||||
resize(screen, TermName, oldtc, newtc)
|
||||
TScreen *screen;
|
||||
char *TermName;
|
||||
@@ -3329,18 +3346,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;
|
||||
@@ -3357,9 +3359,7 @@ char *fmt;
|
||||
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 +3375,8 @@ char *fmt;
|
||||
}
|
||||
|
||||
|
||||
#ifndef USE_TERMIOS
|
||||
-#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 +3394,7 @@ static remove_termcap_entry (buf, str)
|
||||
}
|
||||
return;
|
||||
}
|
||||
-#endif
|
||||
+/*#endif*/
|
||||
|
||||
/*
|
||||
* parse_tty_modes accepts lines of the following form:
|
||||
@@ -3396,7 +3413,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++) {
|
||||
|
|
24
x11/hanterm/patches/patch-button.c
Normal file
24
x11/hanterm/patches/patch-button.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
$NetBSD: patch-button.c,v 1.1 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use standard headers
|
||||
- don't declare own malloc
|
||||
|
||||
--- button.c~ 2001-06-06 13:05:15.000000000 +0000
|
||||
+++ button.c
|
||||
@@ -31,6 +31,7 @@ button.c Handles button events in the te
|
||||
#include "ptyx.h" /* Xlib headers included here. */
|
||||
#include <X11/Xatom.h>
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
#include <X11/Xmu/Atoms.h>
|
||||
#include <X11/Xmu/StdSel.h>
|
||||
@@ -42,8 +43,6 @@ button.c Handles button events in the te
|
||||
|
||||
void TrackText();
|
||||
|
||||
-extern char *malloc();
|
||||
-
|
||||
extern void input_to_chat();
|
||||
extern void HideCursor();
|
||||
extern void DoSecureKeyboard();
|
24
x11/hanterm/patches/patch-chat.c
Normal file
24
x11/hanterm/patches/patch-chat.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
$NetBSD: patch-chat.c,v 1.1 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use standard headers
|
||||
- don't cast the result of calloc
|
||||
|
||||
--- chat.c~ 2001-06-06 13:05:15.000000000 +0000
|
||||
+++ chat.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "error.h"
|
||||
#include "hangul.h"
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#define MAXCHATBUF 1024
|
||||
@@ -61,7 +62,7 @@ toggle_chat_mode(str)
|
||||
chat_x += ST_KBD_LEN;
|
||||
|
||||
if (chat_buf == NULL) {
|
||||
- chat_buf = (Char *)calloc((unsigned)MAXCHATBUF, sizeof(Char));
|
||||
+ chat_buf = calloc((unsigned)MAXCHATBUF, sizeof(Char));
|
||||
if (chat_buf == NULL) {
|
||||
fprintf(stderr, "%s: can't allocate chat buf\n", xterm_name);
|
||||
Cleanup(ERROR_SCALLOC);
|
27
x11/hanterm/patches/patch-screen.c
Normal file
27
x11/hanterm/patches/patch-screen.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
$NetBSD: patch-screen.c,v 1.1 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use standard headers
|
||||
- don't declare own calloc/malloc/realloc/free
|
||||
|
||||
--- screen.c~ 1999-05-31 17:01:47.000000000 +0000
|
||||
+++ screen.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "data.h"
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if defined(SVR4) || defined(sco)
|
||||
@@ -49,11 +50,6 @@
|
||||
extern void HideCursor();
|
||||
extern void ResizeScrollBar();
|
||||
|
||||
-#if !defined(linux) || (__GNUC__ < 2)
|
||||
-extern Char *calloc(), *malloc(), *realloc();
|
||||
-#endif
|
||||
-extern void free();
|
||||
-
|
||||
ScrnBuf Allocate (nrow, ncol, addr)
|
||||
/*
|
||||
allocates memory for a 2-dimensional array of chars and returns a pointer
|
61
x11/hanterm/patches/patch-scrollbar.c
Normal file
61
x11/hanterm/patches/patch-scrollbar.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
$NetBSD: patch-scrollbar.c,v 1.1 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use standard headers
|
||||
- silence warnings about int/pointer casts
|
||||
- don't declare own realloc/calloc
|
||||
|
||||
--- scrollbar.c~ 1999-03-19 06:27:19.000000000 +0000
|
||||
+++ scrollbar.c
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "ptyx.h" /* gets Xt headers, too */
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdint.h>
|
||||
#include <ctype.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
@@ -313,9 +315,6 @@ void ScrollBarOn (xw, init, doalloc)
|
||||
register TScreen *screen = &xw->screen;
|
||||
register int border = 2 * screen->border;
|
||||
register int i;
|
||||
-#if !defined(linux) || (__GNUC__<2)
|
||||
- Char *realloc(), *calloc();
|
||||
-#endif
|
||||
|
||||
if(screen->scrollbar)
|
||||
return;
|
||||
@@ -423,7 +422,7 @@ static void ScrollTextUpDownBy(scrollbar
|
||||
XtPointer client_data;
|
||||
XtPointer call_data;
|
||||
{
|
||||
- int pixels = (int) call_data;
|
||||
+ int pixels = (intptr_t) call_data;
|
||||
|
||||
register TScreen *screen = &term->screen;
|
||||
register int rowOnScreen, newTopLine;
|
||||
@@ -508,9 +507,11 @@ void HandleScrollForward (gw, event, par
|
||||
{
|
||||
XtermWidget w = (XtermWidget) gw;
|
||||
register TScreen *screen = &w->screen;
|
||||
+ int pixels;
|
||||
|
||||
+ pixels = params_to_pixels (screen, params, (int) *nparams);
|
||||
ScrollTextUpDownBy (gw, (XtPointer) NULL,
|
||||
- (XtPointer)params_to_pixels (screen, params, (int) *nparams));
|
||||
+ (XtPointer)(intptr_t)pixels);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -523,8 +524,10 @@ void HandleScrollBack (gw, event, params
|
||||
{
|
||||
XtermWidget w = (XtermWidget) gw;
|
||||
register TScreen *screen = &w->screen;
|
||||
+ int pixels;
|
||||
|
||||
+ pixels = -params_to_pixels (screen, params, (int) *nparams);
|
||||
ScrollTextUpDownBy (gw, (XtPointer) NULL,
|
||||
- (XtPointer)-params_to_pixels (screen, params, (int) *nparams));
|
||||
+ (XtPointer)(intptr_t)pixels);
|
||||
return;
|
||||
}
|
37
x11/hanterm/patches/patch-util.c
Normal file
37
x11/hanterm/patches/patch-util.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
$NetBSD: patch-util.c,v 1.1 2013/11/24 05:53:52 dholland Exp $
|
||||
|
||||
- use standard headers
|
||||
- don't cast result of malloc
|
||||
|
||||
--- util.c~ 1999-03-05 06:59:09.000000000 +0000
|
||||
+++ util.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "menu.h"
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
extern void HideCursor();
|
||||
extern void ScrollBarReverseVideo();
|
||||
@@ -1126,8 +1127,8 @@ int xstrcasecmp(s1, s2)
|
||||
int i, r;
|
||||
char *t1, *t2;
|
||||
|
||||
- t1 = (char *)malloc(strlen(s1)+1);
|
||||
- t2 = (char *)malloc(strlen(s2)+1);
|
||||
+ t1 = malloc(strlen(s1)+1);
|
||||
+ t2 = malloc(strlen(s2)+1);
|
||||
|
||||
for(i=0; s1[i]; i++) t1[i] = x2lower(s1[i]);
|
||||
t1[i] = 0;
|
||||
@@ -1147,8 +1148,8 @@ int xstrncasecmp(s1, s2, n)
|
||||
int i, r;
|
||||
char *t1, *t2;
|
||||
|
||||
- t1 = (char *)malloc(strlen(s1)+1);
|
||||
- t2 = (char *)malloc(strlen(s2)+1);
|
||||
+ t1 = malloc(strlen(s1)+1);
|
||||
+ t2 = malloc(strlen(s2)+1);
|
||||
|
||||
for(i=0; s1[i]; i++) t1[i] = x2lower(s1[i]);
|
||||
t1[i] = 0;
|
Loading…
Reference in a new issue