diff --git a/ansi.c b/ansi.c index 9b1072c..1658d0d 100644 --- a/ansi.c +++ b/ansi.c @@ -252,7 +252,7 @@ int f, n; /* default flag, numeric argument [unused] */ } #endif #else -static void ansihello(void) +void ansihello(void) { } #endif diff --git a/bind.c b/bind.c index 856ae9d..e8ec063 100644 --- a/bind.c +++ b/bind.c @@ -19,7 +19,7 @@ int help(int f, int n) into it with view mode */ register window_t *wp; /* scaning pointer to windows */ register BUFFER *bp; /* buffer pointer to help */ - char *fname; /* ptr to file returned by flook() */ + char *fname = NULL; /* ptr to file returned by flook() */ /* first check if we are already here */ bp = bfind("emacs.hlp", FALSE, BFINVS); diff --git a/crypt.c b/crypt.c index 4186651..5a09f4b 100644 --- a/crypt.c +++ b/crypt.c @@ -20,7 +20,7 @@ static int mod95(int); * int f; default flag * int n; numeric argument */ -int setkey(int f, int n) +int set_encryption_key(int f, int n) { register int status; /* return status */ int odisinp; /* original vlaue of disinp */ @@ -37,8 +37,8 @@ int setkey(int f, int n) return (status); /* and encrypt it */ - crypt((char *) NULL, 0); - crypt(key, strlen(key)); + myencrypt((char *) NULL, 0); + myencrypt(key, strlen(key)); /* and save it off */ strcpy(curbp->b_key, key); @@ -48,7 +48,7 @@ int setkey(int f, int n) /********** * - * crypt - in place encryption/decryption of a buffer + * myencrypt - in place encryption/decryption of a buffer * * (C) Copyright 1986, Dana L. Hoggatt * 1216, Beck Lane, Lafayette, IN @@ -77,7 +77,7 @@ int setkey(int f, int n) * 4. The system needed to be secure against all but the * most determined of attackers. * - * For encryption of a block of data, one calls crypt passing + * For encryption of a block of data, one calls myencrypt passing * a pointer to the data block and its length. The data block is * encrypted in place, that is, the encrypted output overwrites * the input. Decryption is totally isomorphic, and is performed @@ -86,9 +86,9 @@ int setkey(int f, int n) * Before using this routine for encrypting data, you are expected * to specify an encryption key. This key is an arbitrary string, * to be supplied by the user. To set the key takes two calls to - * crypt(). First, you call + * myencrypt(). First, you call * - * crypt(NULL, vector) + * myencrypt(NULL, vector) * * This resets all internal control information. Typically (and * specifically in the case on MICRO-emacs) you would use a "vector" @@ -99,9 +99,9 @@ int setkey(int f, int n) * * Then, you "encrypt" your password by calling * - * crypt(pass, strlen(pass)) + * myencrypt(pass, strlen(pass)) * - * where "pass" is your password string. Crypt() will destroy + * where "pass" is your password string. Myencrypt() will destroy * the original copy of the password (it becomes encrypted), * which is good. You do not want someone on a multiuser system * to peruse your memory space and bump into your password. @@ -143,7 +143,7 @@ int setkey(int f, int n) * **********/ -void crypt(char *bptr, unsigned len) +void myencrypt(char *bptr, unsigned len) { register int cc; /* current character being considered */ @@ -217,7 +217,7 @@ static int mod95(int val) return (val); } #else -static void nocrypt(void) +static void myennocrypt(void) { } #endif diff --git a/ebind.h b/ebind.h index 915a825..eeb81a1 100644 --- a/ebind.h +++ b/ebind.h @@ -248,7 +248,7 @@ KEYTAB keytab[NBINDS] = { {META | 'D', delfword} , #if CRYPT - {META | 'E', setkey} + {META | 'E', set_encryption_key} , #endif {META | 'F', forwword} diff --git a/efunc.h b/efunc.h index 4770ccc..8fced49 100644 --- a/efunc.h +++ b/efunc.h @@ -225,7 +225,6 @@ extern int fileread(int f, int n); extern int insfile(int f, int n); extern int filefind(int f, int n); extern int viewfile(int f, int n); -extern int resetkey(void); extern int getfile(char *fname, int lockfl); extern int readin(char *fname, int lockfl); extern void makename(char *bname, char *fname); @@ -365,8 +364,8 @@ extern int sindex(char *source, char *pattern); extern char *xlat(char *source, char *lookup, char *trans); /* crypt.c */ -extern int setkey(int f, int n); -extern void crypt(char *bptr, unsigned len); +extern int set_encryption_key(int f, int n); +extern void myencrypt(char *bptr, unsigned len); /* lock.c */ extern int lockchk(char *fname); diff --git a/eval.c b/eval.c index 23244e9..290b4e7 100644 --- a/eval.c +++ b/eval.c @@ -448,10 +448,12 @@ int setvar(int f, int n) */ void findvar(char *var, VDESC *vd, int size) { - register int vnum; /* subscript in varable arrays */ + register int vnum; /* subscript in variable arrays */ register int vtype; /* type to return */ - fvar:vtype = -1; + vnum = -1; +fvar: + vtype = -1; switch (var[0]) { case '$': /* check for legal enviromnent var */ diff --git a/file.c b/file.c index a4d2701..34efe58 100644 --- a/file.c +++ b/file.c @@ -101,7 +101,7 @@ int viewfile(int f, int n) } #if CRYPT -int resetkey(void) +static int resetkey(void) { /* reset the encryption key if needed */ register int s; /* return status */ @@ -111,7 +111,7 @@ int resetkey(void) /* if we are in crypt mode */ if (curbp->b_mode & MDCRYPT) { if (curbp->b_key[0] == 0) { - s = setkey(FALSE, 0); + s = set_encryption_key(FALSE, 0); if (s != TRUE) return (s); } @@ -121,12 +121,12 @@ int resetkey(void) /* and set up the key to be used! */ /* de-encrypt it */ - crypt((char *) NULL, 0); - crypt(curbp->b_key, strlen(curbp->b_key)); + myencrypt((char *) NULL, 0); + myencrypt(curbp->b_key, strlen(curbp->b_key)); /* re-encrypt it...seeding it to start */ - crypt((char *) NULL, 0); - crypt(curbp->b_key, strlen(curbp->b_key)); + myencrypt((char *) NULL, 0); + myencrypt(curbp->b_key, strlen(curbp->b_key)); } return (TRUE); diff --git a/fileio.c b/fileio.c index 6f8eac0..e3b12c7 100644 --- a/fileio.c +++ b/fileio.c @@ -87,7 +87,7 @@ int ffputline(char *buf, int nbuf) if (cryptflag) { for (i = 0; i < nbuf; ++i) { c = buf[i] & 0xff; - crypt(&c, 1); + myencrypt(&c, 1); fputc(c, ffp); } } else @@ -195,7 +195,7 @@ int ffgetline(void) fline[i] = 0; #if CRYPT if (cryptflag) - crypt(fline, strlen(fline)); + myencrypt(fline, strlen(fline)); #endif return (FIOSUC); } diff --git a/ibmpc.c b/ibmpc.c index f184abc..3c09f4c 100644 --- a/ibmpc.c +++ b/ibmpc.c @@ -502,7 +502,7 @@ int f, n; /* default flag, numeric argument [unused] */ } #endif #else -static void ibmhello(void) +void ibmhello(void) { } #endif diff --git a/input.c b/input.c index bc5a12d..dfac2a5 100644 --- a/input.c +++ b/input.c @@ -439,7 +439,7 @@ int getstring(char *prompt, char *buf, int nbuf, int eolchar) register int c; register int quotef; /* are we quoting the next char? */ #if COMPLC - int ffile, ocpos, nskip, didtry = 0; + int ffile, ocpos, nskip = 0, didtry = 0; #if MSDOS struct ffblk ffblk; char *fcp; diff --git a/main.c b/main.c index 685a1db..d9451f3 100644 --- a/main.c +++ b/main.c @@ -236,8 +236,8 @@ int main(int argc, char **argv) #if CRYPT if (cryptflag) { bp->b_mode |= MDCRYPT; - crypt((char *) NULL, 0); - crypt(ekey, strlen(ekey)); + myencrypt((char *) NULL, 0); + myencrypt(ekey, strlen(ekey)); strncpy(bp->b_key, ekey, NPAT); } #endif diff --git a/makefile b/makefile index 77f333a..73f4c43 100644 --- a/makefile +++ b/makefile @@ -20,7 +20,7 @@ CFLAGS=-O2 -Wall #CFLAGS= -D_HPUX_SOURCE -DSYSV #CFLAGS=-O4 -DSVR4 # Sun #CFLAGS=-O -qchars=signed # RS/6000 -DEFINES=-DAUTOCONF -DPOSIX -DUSG # Linux +DEFINES=-DAUTOCONF -DPOSIX -DUSG -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE=600 # Linux #DEFINES=-DAUTOCONF #LIBS=-ltermcap # BSD #LIBS=-lcurses # SYSV diff --git a/names.c b/names.c index 8e92607..510f080 100644 --- a/names.c +++ b/names.c @@ -191,7 +191,7 @@ NBIND names[] = { {"select-buffer", usebuffer}, {"set", setvar}, #if CRYPT - {"set-encryption-key", setkey}, + {"set-encryption-key", set_encryption_key}, #endif {"set-fill-column", setfillcol}, {"set-mark", setmark}, diff --git a/random.c b/random.c index 789643b..c556364 100644 --- a/random.c +++ b/random.c @@ -49,6 +49,9 @@ int showcpos(int f, int n) /* start counting chars and lines */ numchars = 0; numlines = 0; + predchars = 0; + predlines = 0; + curchar = 0; while (lp != curbp->b_linep) { /* if we are on the current line, record it */ if (lp == curwp->w_dotp) { diff --git a/tcap.c b/tcap.c index 318cdbd..ca87368 100644 --- a/tcap.c +++ b/tcap.c @@ -66,8 +66,10 @@ static char *UP, PC, *CM, *CE, *CL, *SO, *SE; #if PKCODE static char *TI, *TE; +#if USE_BROKEN_OPTIMIZATION static int term_init_ok = 0; #endif +#endif #if SCROLLCODE static char *CS, *DL, *AL, *SF, *SR; diff --git a/vmsvt.c b/vmsvt.c index 9eaaf11..338831d 100644 --- a/vmsvt.c +++ b/vmsvt.c @@ -518,7 +518,7 @@ spal() * * Nothing returned ***/ -static void hellovms(void) +void hellovms(void) { } diff --git a/vt52.c b/vt52.c index 190526e..6e17683 100644 --- a/vt52.c +++ b/vt52.c @@ -178,7 +178,7 @@ int f, n; /* default flag, numeric argument [unused] */ #endif #else -static void vt52hello(void) +void vt52hello(void) { }