diff options
author | ben <ben> | 2003-12-06 19:28:22 +0000 |
---|---|---|
committer | ben <ben> | 2003-12-06 19:28:22 +0000 |
commit | 7889126b8b49a1fd068c5ac8125b658c5d48fa04 (patch) | |
tree | 5434b6b5b5faa3e6db03688e46ad82af0c3a825f /games | |
parent | 71c89f8b5eda0e6d904ce36fc2a268fbbe97d25c (diff) | |
download | pkgsrc-7889126b8b49a1fd068c5ac8125b658c5d48fa04.tar.gz |
Update Ularn to fix a few things:
* Replace varargs with stdarg, in order to compile under gcc 3.3.
* Replace mktemp with mkstemp, in order to silence warnings
* Remove share directory from PLIST, since score file is not deleted.
Diffstat (limited to 'games')
-rw-r--r-- | games/ularn/Makefile | 3 | ||||
-rw-r--r-- | games/ularn/PLIST | 3 | ||||
-rw-r--r-- | games/ularn/distinfo | 12 | ||||
-rw-r--r-- | games/ularn/patches/patch-ae | 27 | ||||
-rw-r--r-- | games/ularn/patches/patch-ah | 26 | ||||
-rw-r--r-- | games/ularn/patches/patch-aj | 18 | ||||
-rw-r--r-- | games/ularn/patches/patch-al | 78 | ||||
-rw-r--r-- | games/ularn/patches/patch-aw | 66 |
8 files changed, 142 insertions, 91 deletions
diff --git a/games/ularn/Makefile b/games/ularn/Makefile index 46305c72bfc..24c354bd7fb 100644 --- a/games/ularn/Makefile +++ b/games/ularn/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.9 2003/12/06 18:26:47 ben Exp $ +# $NetBSD: Makefile,v 1.10 2003/12/06 19:28:22 ben Exp $ DISTNAME= ularn PKGNAME= ularn-6.12.92 +PKGREVISION= 1 WRKSRC= ${WRKDIR} CATEGORIES= games MASTER_SITES= http://www.cordier.com/ularn/ diff --git a/games/ularn/PLIST b/games/ularn/PLIST index 94a4bbe53f1..38ccb084e5b 100644 --- a/games/ularn/PLIST +++ b/games/ularn/PLIST @@ -1,6 +1,5 @@ -@comment $NetBSD: PLIST,v 1.1 2001/11/01 00:55:56 zuntum Exp $ +@comment $NetBSD: PLIST,v 1.2 2003/12/06 19:28:22 ben Exp $ bin/Ularn share/Ularn/Uhelp share/Ularn/Umaps share/Ularn/Ufortune -@dirrm share/Ularn diff --git a/games/ularn/distinfo b/games/ularn/distinfo index cc1d24fdaf9..d2f2122ae4f 100644 --- a/games/ularn/distinfo +++ b/games/ularn/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2002/01/03 13:06:50 wiz Exp $ +$NetBSD: distinfo,v 1.3 2003/12/06 19:28:22 ben Exp $ SHA1 (ularn.tar.gz) = abc5bbecca65968e9ddaf2a8d07ac5141009459d Size (ularn.tar.gz) = 142790 bytes @@ -6,14 +6,14 @@ SHA1 (patch-aa) = 729fbce5942d1a8867ffcdb79a1bbfd516535106 SHA1 (patch-ab) = a45fec8456da7b2b1985dc2332ede80082b2dab4 SHA1 (patch-ac) = 859fb4ae3782658d2f2cf29d11da67a901499e61 SHA1 (patch-ad) = ecf9b099ac8df2b86a9c45c0cf76c7caf194f64b -SHA1 (patch-ae) = 6232c2735b01a275f840c458bf78618094c99e27 +SHA1 (patch-ae) = a6a68608da9daf237701ea18c2462e2de6c29413 SHA1 (patch-af) = 252c2f2d318189efc9ab5d2ec78ff78c3d54fb68 SHA1 (patch-ag) = 85dd443611465ddb3fc9819e8d69dd6028fa6fe7 -SHA1 (patch-ah) = ad5134994d8280fd3331a214eb5321b3cd541ed3 +SHA1 (patch-ah) = b56861b88f5abd7da2e2b0f5de4dc1f7261ff235 SHA1 (patch-ai) = 43b9a2fb45a2a52347f0a83efca5ba70c3c58989 -SHA1 (patch-aj) = 34336ad095ecbba9c28cea1cb8f6d0d8023251a6 +SHA1 (patch-aj) = 09b5d87673103739c6bf7dfbf44c6fb8808fbd28 SHA1 (patch-ak) = d2cb3bda3c2e95868362a0d0dcf4bb584d6df987 -SHA1 (patch-al) = cb3b13211c8897e0138347c74557dcbb7d318244 +SHA1 (patch-al) = ce8015f7f4b767549ba9d790f369bcfe8fdac287 SHA1 (patch-am) = 1df190db775f3d2278275894f18246e4897738e0 SHA1 (patch-an) = 8c669a56795a8b4a2a6e24fd2fb121aa0699c01a SHA1 (patch-ao) = 42a184fea3408fc935f3dcc62b7a127e81b71085 @@ -24,7 +24,7 @@ SHA1 (patch-as) = faec3ca3cd3d0ded4f0cf0740fd856dbecbd0841 SHA1 (patch-at) = f0fd98ce48e779e63122a8311d4a4223cda5a751 SHA1 (patch-au) = 09f12532f42d39b59381d12c115842d5c7b8c7f3 SHA1 (patch-av) = 028b49f03ca8e63f1adee5eb82460de2855aa6cb -SHA1 (patch-aw) = 4e0e0501946928775e80f831f081fde887ddb67d +SHA1 (patch-aw) = fac054bd83a12048a33991cf2be181aab44d0294 SHA1 (patch-ax) = 31f39079aeb8ccf490cc7fbbd1d3c70d9f0737ed SHA1 (patch-ay) = 72bc4da5ec2006f3b1b4f29afec085e13f94ed11 SHA1 (patch-az) = a2fbfbfacc77f297f77322ce66f30bf25bddbbfd diff --git a/games/ularn/patches/patch-ae b/games/ularn/patches/patch-ae index 824aa89efec..ba11dd13c99 100644 --- a/games/ularn/patches/patch-ae +++ b/games/ularn/patches/patch-ae @@ -1,8 +1,17 @@ -$NetBSD: patch-ae,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ +$NetBSD: patch-ae,v 1.2 2003/12/06 19:28:22 ben Exp $ ---- data.c.orig Fri Jun 19 13:55:29 1992 -+++ data.c Sun Jan 14 13:42:03 2001 -@@ -114,27 +114,27 @@ +--- data.c.orig 1992-06-19 13:55:29.000000000 -0700 ++++ data.c +@@ -102,7 +102,7 @@ long skill[] = { + }; + #undef MEG + +-char *tempfilename; ++char *tempfilename = NULL; + + char *lpbuf, + *lpnt, +@@ -114,27 +114,27 @@ char loginname[20]; /* players login na char logname[LOGNAMESIZE]; /* players name storage for scoring */ char char_class[20]; /* character class */ @@ -44,7 +53,7 @@ $NetBSD: patch-ae,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ ** 2 means that the trap handling routines must do a ** showplayer() after a trap. 0 means don't showplayer() ** 0 - we are in create player screen -@@ -142,27 +142,29 @@ +@@ -142,27 +142,29 @@ char predostuff=0; /* ** 2 - we are in the normal game */ @@ -95,7 +104,7 @@ $NetBSD: patch-ae,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ long initialtime=0; /* time playing began */ long gtime=0; /* the clock for the game */ -@@ -289,7 +291,7 @@ +@@ -289,7 +291,7 @@ char *objectname[]= * * array to do rnd() to create monsters <= a given level */ @@ -104,7 +113,7 @@ $NetBSD: patch-ae,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ struct monst monster[] = { -@@ -380,82 +382,85 @@ +@@ -380,82 +382,85 @@ struct monst monster[] = { /* name array for scrolls */ char *scrollname[MAXSCROLL] = { @@ -255,7 +264,7 @@ $NetBSD: patch-ae,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ 1,4,7,11,15, 20,24,28,30,32, 33,34,35,36,37, -@@ -762,7 +767,7 @@ +@@ -762,7 +767,7 @@ char *spelmes[] = { * 20 - remove curse 21 - annihilation * 22 - pulverization 23 - life protection */ @@ -264,7 +273,7 @@ $NetBSD: patch-ae,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, -@@ -800,15 +805,15 @@ +@@ -800,15 +805,15 @@ char scprob[]= { * 22 - poison * 23 - see invisible */ diff --git a/games/ularn/patches/patch-ah b/games/ularn/patches/patch-ah index aff4972dcd5..c13aa059193 100644 --- a/games/ularn/patches/patch-ah +++ b/games/ularn/patches/patch-ah @@ -1,7 +1,7 @@ -$NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ +$NetBSD: patch-ah,v 1.2 2003/12/06 19:28:22 ben Exp $ ---- extern.h.orig Fri Jun 19 13:55:30 1992 -+++ extern.h Sat Jan 13 21:29:33 2001 +--- extern.h.orig 1992-06-19 13:55:30.000000000 -0700 ++++ extern.h @@ -2,19 +2,19 @@ /* module: action.c */ @@ -32,7 +32,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ /* module: bill.c */ -@@ -24,53 +24,53 @@ +@@ -24,53 +24,53 @@ int letter3(void); int letter4(void); int letter5(void); int letter6(void); @@ -115,7 +115,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ /* module: fortune.c */ -@@ -78,178 +78,178 @@ +@@ -78,178 +78,178 @@ char *fortune(char *); /* module: help.c */ @@ -136,7 +136,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ -int lprintf(); -int lprint(long); -int lwrite(char *, int); -+void lprintf(); ++void lprintf(char *, ...); +void lprint(long); +void lwrite(char *, int); long lgetc1(void); @@ -403,7 +403,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ unsigned int sum(unsigned char *, int); /* module: scores.c */ -@@ -261,112 +261,112 @@ +@@ -261,112 +261,112 @@ int hashewon(void); long paytaxes(long); int winshou(void); int shou(int); @@ -592,7 +592,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ /* module: bill.c */ -@@ -376,53 +376,53 @@ +@@ -376,53 +376,53 @@ int letter3(); int letter4(); int letter5(); int letter6(); @@ -675,7 +675,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ /* module: fortune.c */ -@@ -430,178 +430,178 @@ +@@ -430,178 +430,178 @@ char *fortune(); /* module: help.c */ @@ -696,7 +696,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ -int lprintf(); -int lprint(); -int lwrite(); -+void lprintf(); ++void lprintf(char *, ...); +void lprint(); +void lwrite(); long lgetc1(); @@ -963,7 +963,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ unsigned int sum(); /* module: scores.c */ -@@ -613,96 +613,96 @@ +@@ -613,96 +613,96 @@ int hashewon(); long paytaxes(); int winshou(); int shou(); @@ -1129,7 +1129,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ #endif /* __STD__ */ -@@ -718,20 +718,20 @@ +@@ -718,20 +718,20 @@ extern char savefilename[],scorefile[], extern char objnamelist[],optsfile[],*potionname[],stealth[MAXX][MAXY]; extern char *scrollname[],*spelcode[],*speldescript[]; extern char *class[],course[],diagfile[],fortfile[],helpfile[]; @@ -1155,7 +1155,7 @@ $NetBSD: patch-ah,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $ extern char ramboflag, compress; extern short hitp[MAXX][MAXY], ivenarg[], screen[MAXX][MAXY]; -@@ -739,6 +739,17 @@ +@@ -739,6 +739,17 @@ extern short iarg[MAXX][MAXY], lastnum; extern int yrepcount,userid; extern int ipoint, iepoint; diff --git a/games/ularn/patches/patch-aj b/games/ularn/patches/patch-aj index ce479466c43..82c69588421 100644 --- a/games/ularn/patches/patch-aj +++ b/games/ularn/patches/patch-aj @@ -1,8 +1,18 @@ -$NetBSD: patch-aj,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ +$NetBSD: patch-aj,v 1.2 2003/12/06 19:28:22 ben Exp $ ---- header.h.orig Sat Jan 13 21:51:26 2001 -+++ header.h Sat Jan 13 21:51:43 2001 -@@ -120,7 +120,7 @@ +--- header.h.orig 1992-06-19 13:55:30.000000000 -0700 ++++ header.h +@@ -27,7 +27,8 @@ + #include <pwd.h> + #include <signal.h> + #include <stdio.h> +-#include <varargs.h> ++#include <stdarg.h> ++#include <stdlib.h> + #ifdef USG + # include <strings.h> + #else +@@ -120,7 +121,7 @@ #define resetbold() {if (boldon) *lpnt++ = ST_END;} /* clear the screen and home the cursor */ diff --git a/games/ularn/patches/patch-al b/games/ularn/patches/patch-al index c60d35668b0..7a5ca78ac9f 100644 --- a/games/ularn/patches/patch-al +++ b/games/ularn/patches/patch-al @@ -1,7 +1,7 @@ -$NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ +$NetBSD: patch-al,v 1.2 2003/12/06 19:28:22 ben Exp $ ---- io.c.orig Wed Jan 18 11:48:27 1995 -+++ io.c Sun Jan 14 07:56:12 2001 +--- io.c.orig 1995-01-18 11:48:27.000000000 -0800 ++++ io.c @@ -47,6 +47,12 @@ * * Note: ** entries are available only in termcap mode. @@ -15,7 +15,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ #include "header.h" #include "extern.h" -@@ -61,13 +67,13 @@ +@@ -61,13 +67,13 @@ static char lgetwbuf[LINBUFSIZE]; /* get /* * getcharacter() Routine to read in one character from the terminal */ @@ -31,7 +31,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ } -@@ -75,7 +81,7 @@ +@@ -75,7 +81,7 @@ getcharacter () * newgame() * Subroutine to save the initial time and seed rnd() */ @@ -40,16 +40,28 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { long *p,*pe; -@@ -101,7 +107,7 @@ +@@ -101,18 +107,14 @@ newgame () */ /*VARARGS*/ -lprintf(va_alist) -+void lprintf(va_alist) - va_dcl +-va_dcl ++void lprintf(char *fmt, ...) { va_list ap; /* pointer for variable argument list */ -@@ -164,7 +170,7 @@ +- char *fmt; + char *outb,*tmpb; + long wide,left,cont,n; /* data for lprintf */ + char db[12]; /* %d buffer in lprintf */ + +- va_start(ap); /* initialize the var args pointer */ +- +- fmt = (char *)va_arg(ap, char *); /* pointer to format string */ ++ va_start(ap, fmt); /* initialize the var args pointer */ + + if (lpnt >= lpend) lflush(); + outb = lpnt; +@@ -164,7 +166,7 @@ va_dcl break; } if (wide==0) { @@ -58,7 +70,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ --outb; } else { -@@ -172,7 +178,7 @@ +@@ -172,7 +174,7 @@ va_dcl if (left) while (n-- > 0) *outb++ = ' '; @@ -67,7 +79,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ ; --outb; if (left==0) -@@ -230,7 +236,7 @@ +@@ -230,7 +232,7 @@ va_dcl * No checking for output buffer overflow is done, but flushes if needed! * Returns nothing of value. */ @@ -76,7 +88,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ long x; { if (lpnt >= lpend) -@@ -251,7 +257,7 @@ +@@ -251,7 +253,7 @@ long x; * Enter with the address and number of bytes to write out * Returns nothing of value */ @@ -85,7 +97,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *buf; int len; { -@@ -286,7 +292,7 @@ +@@ -286,7 +288,7 @@ int len; * * Returns 0 if EOF, otherwise the character */ @@ -94,7 +106,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { int i; -@@ -320,7 +326,7 @@ +@@ -320,7 +322,7 @@ long lgetc1() * The save order is low order first, to high order (4 bytes total) * Returns the int read */ @@ -103,7 +115,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { long i; -@@ -339,7 +345,7 @@ +@@ -339,7 +341,7 @@ long lrint() * Reads "number" bytes into the buffer pointed to by "address". * Returns nothing of value */ @@ -112,7 +124,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *adr; int num; { -@@ -379,7 +385,7 @@ +@@ -379,7 +381,7 @@ int num; * * Returns pointer to a buffer that contains word. If EOF, returns a 0 */ @@ -121,7 +133,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { char *lgp; int cc, n=LINBUFSIZE, quote=0; -@@ -412,7 +418,7 @@ +@@ -412,7 +414,7 @@ char *lgetw() * *Returns pointer to a buffer that contains the line. If EOF, returns 0 */ @@ -130,7 +142,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { int i=LINBUFSIZE,ch; char *str=lgetwbuf; -@@ -437,7 +443,7 @@ +@@ -437,7 +439,7 @@ char *lgetl() * lcreat((char*)0); means to the terminal * Returns -1 if error, otherwise the file descriptor opened. */ @@ -139,7 +151,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *str; { lpnt = lpbuf; -@@ -461,7 +467,7 @@ +@@ -461,7 +463,7 @@ char *str; * lopen(0) means from the terminal * Returns -1 if error, otherwise the file descriptor opened. */ @@ -148,7 +160,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *str; { ipoint = iepoint = BUFSIZ; -@@ -484,7 +490,7 @@ +@@ -484,7 +486,7 @@ char *str; * lappend(0) means to the terminal * Returns -1 if error, otherwise the file descriptor opened. */ @@ -157,7 +169,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *str; { lpnt = lpbuf; -@@ -507,7 +513,7 @@ +@@ -507,7 +509,7 @@ char *str; * * Returns nothing of value. */ @@ -166,7 +178,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { if (fd > 0) close(fd); -@@ -518,7 +524,7 @@ +@@ -518,7 +520,7 @@ lrclose() * * Returns nothing of value. */ @@ -175,7 +187,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { lflush(); if (lfd > 2) -@@ -529,7 +535,7 @@ +@@ -529,7 +531,7 @@ lwclose () * lprcat(string) append a string to the output buffer * avoids calls to lprintf (time consuming) */ @@ -184,7 +196,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *str; { char *str2; -@@ -537,8 +543,7 @@ +@@ -537,8 +539,7 @@ char *str; if (lpnt >= lpend) lflush(); str2 = lpnt; @@ -194,7 +206,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ lpnt = str2 - 1; } -@@ -553,15 +558,16 @@ +@@ -553,15 +554,16 @@ static char cap[256]; static char *outbuf=0; /* translated output buffer */ char *CM, *CE, *CD, *CL, *SO, *SE, *AL, *DL;/* Termcap capabilities */ char *HO, *BC, *UP; @@ -214,7 +226,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *malloc(), *tgetstr(), *term, *getenv(); switch (tgetent(termbuf, term = getenv("TERM"))) { -@@ -584,12 +590,11 @@ +@@ -584,12 +586,11 @@ init_term () UP = tgetstr("up", &capptr); /* cursor up */ HO = tgetstr("ho", &capptr); /* home cursor */ @@ -231,7 +243,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ if (!(BC = tgetstr("bc", &capptr))) { /* backspace */ if (!(BC=tgetstr("le", &capptr))) { -@@ -632,7 +637,7 @@ +@@ -632,7 +633,7 @@ init_term () /* * cl_up(x,y) Clear screen from [x,1] to current position. Leave cursor at [x,y] */ @@ -240,7 +252,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ int x, y; { int i; -@@ -648,7 +653,7 @@ +@@ -648,7 +649,7 @@ int x, y; /* * cl_dn(x,y) Clear screen from [1,y] to end of display. Leave cursor at [x,y] */ @@ -249,7 +261,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ int x, y; { int i; -@@ -671,7 +676,7 @@ +@@ -671,7 +672,7 @@ int x, y; /* * standout(str) Print the argument string in inverse video (standout mode). */ @@ -258,7 +270,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *str; { if (boldon == 0) { -@@ -687,7 +692,7 @@ +@@ -687,7 +688,7 @@ char *str; /* * set_score_output() Called when output should be literally printed. */ @@ -267,7 +279,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ enable_scroll = -1; } -@@ -700,7 +705,7 @@ +@@ -700,7 +701,7 @@ set_score_output() { */ static int scrline=18; /* line # for wraparound instead of scrolling if no DL */ @@ -276,7 +288,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { int lpoint; char *str; -@@ -796,18 +801,19 @@ +@@ -796,18 +797,19 @@ static int ind=0; /* * putcharacter(c) Print one character in decoded output buffer. */ @@ -298,7 +310,7 @@ $NetBSD: patch-al,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { if (ind) write(lfd, outbuf, ind); -@@ -825,7 +831,7 @@ +@@ -825,7 +827,7 @@ flush_buf() * * */ diff --git a/games/ularn/patches/patch-aw b/games/ularn/patches/patch-aw index e0b7d31ef13..de533f59b37 100644 --- a/games/ularn/patches/patch-aw +++ b/games/ularn/patches/patch-aw @@ -1,7 +1,7 @@ -$NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ +$NetBSD: patch-aw,v 1.2 2003/12/06 19:28:22 ben Exp $ ---- savelev.c.orig Fri Jun 19 13:55:34 1992 -+++ savelev.c Sun Jan 14 15:27:32 2001 +--- savelev.c.orig 1992-06-19 13:55:34.000000000 -0700 ++++ savelev.c @@ -1,4 +1,6 @@ /* savelev.c */ +#include <stdlib.h> @@ -20,7 +20,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ typedef struct_mitem Mitem_Ary[MAXX][MAXY]; static int w = 0; -@@ -19,11 +19,11 @@ +@@ -19,11 +19,11 @@ static int r = 0; /* this is the structure that holds the entire dungeon specifications */ typedef struct save_lev_str { @@ -36,7 +36,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ } Saved_Level; static Saved_Level *saved_levels[NLEVELS]; -@@ -33,15 +33,15 @@ +@@ -33,15 +33,15 @@ static unsigned int FileSum; /* * routine to save the present level into storage */ @@ -57,7 +57,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ level_sums[level] = sum((unsigned char *)storage, sizeof(Saved_Level)); } -@@ -49,17 +49,17 @@ +@@ -49,17 +49,17 @@ savelevel() /* * routine to restore a level from storage */ @@ -80,7 +80,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ if (level_sums[level] > 0) { if ((i = sum((unsigned char *)storage,sizeof(Saved_Level))) -@@ -82,7 +82,7 @@ +@@ -82,7 +82,7 @@ getlevel() /* * to save the game in a file */ @@ -89,7 +89,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ char *fname; { int i; -@@ -145,10 +145,10 @@ +@@ -145,10 +145,10 @@ char *fname; bwrite(fd,(char * )char_class, 20 * sizeof(char)); for (i=0; i<MAXSCROLL; i++) @@ -102,7 +102,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ bwrite(fd,(char *)spelknow, sizeof(char) * SPNUM); bwrite(fd,(char *)&wizard, sizeof(wizard)); -@@ -192,18 +192,22 @@ +@@ -192,18 +192,22 @@ char *fname; } @@ -116,19 +116,39 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ Saved_Level * storage; - char buf[1024], *tmp="/tmp/UtmpXXXXXX", *mktemp(); + char buf[1024]; -+ char *tmp; int fd; -+ tmp = strdup("/tmp/UtmpXXXXXX"); ++ if (tempfilename != NULL) ++ free(tempfilename); ++ tempfilename = strdup("/tmp/UtmpXXXXXX"); if (compress) { - if ((tempfilename = mktemp(tmp)) == NULL) { -+ tempfilename = mktemp(tmp); -+ free(tmp); -+ if (tempfilename == NULL) { ++ fd = mkstemp(tempfilename); ++ if (fd == -1) { fprintf(stderr,"Can't create temp file to restore game\n"); perror("mktemp"); nosignal=0; -@@ -273,10 +277,10 @@ +@@ -221,15 +225,18 @@ char *fname; + sleep(4); + c[GOLD] = c[BANKACCOUNT] = 0; + died(-265); ++ close(fd); + unlink(tempfilename); + return; + } +- if ((fd = open(tempfilename, O_RDONLY)) < 0) { ++ if (lseek(fd, 0, SEEK_SET) < 0) { + fprintf(stderr,"Can't open temp file to restore game\n"); + perror("open"); + sleep(4); + c[GOLD] = c[BANKACCOUNT] = 0; + died(-265); ++ close(fd); ++ unlink(tempfilename); + return; + } + } else { +@@ -273,10 +280,10 @@ char *fname; bread(fd,(char * )char_class, sizeof(char) * 20); for (i=0; i<MAXSCROLL; i++) @@ -141,7 +161,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ bread(fd,(char * )spelknow, sizeof(char) * SPNUM); -@@ -350,7 +354,7 @@ +@@ -350,7 +357,7 @@ char *fname; /* subroutine to not allow greedy cheaters */ @@ -150,7 +170,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { if (wizard) return; -@@ -370,7 +374,7 @@ +@@ -370,7 +377,7 @@ lprcat("In that you are GREEDY as well a subroutine to not allow altered save files and terminate the attempted restart */ @@ -159,7 +179,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { if (cheat) return; -@@ -385,7 +389,7 @@ +@@ -385,7 +392,7 @@ fsorry() /* subroutine to not allow game if save file can't be deleted */ @@ -168,7 +188,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { if (wizard) return; -@@ -403,7 +407,7 @@ +@@ -403,7 +410,7 @@ lprcat("is in. Since this is unfair to } @@ -177,7 +197,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ { int i; -@@ -415,18 +419,20 @@ +@@ -415,18 +422,20 @@ init_cells() } @@ -200,7 +220,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ fprintf(stderr, " Wrote %d bytes so far\n", w); fprintf(stderr, " Call: %d\n", ncalls); abort(); -@@ -437,7 +443,7 @@ +@@ -437,7 +446,7 @@ long num; w += nwrote; if (nwrote != num) { fprintf(stderr, "Error writing to save file\n"); @@ -209,7 +229,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ fprintf(stderr, " Wrote %d bytes so far\n", w); fprintf(stderr, " Call: %d\n", ncalls); sleep(4); -@@ -446,18 +452,20 @@ +@@ -446,18 +455,20 @@ long num; FileSum += sum((unsigned char *)buf, num); } @@ -232,7 +252,7 @@ $NetBSD: patch-aw,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $ fprintf(stderr, " Read %d bytes so far\n", w); fprintf(stderr, " Call: %d\n", ncalls); perror("read"); -@@ -467,7 +475,7 @@ +@@ -467,7 +478,7 @@ long num; r += nread; if (nread != num) { fprintf(stderr, "Error reading save file\n"); |