1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1997 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
44 |
|
|
45 |
|
unsigned long eclock = 0; /* value storage timer */ |
46 |
|
|
47 |
< |
static char context[MAXWORD+1]; /* current context path */ |
47 |
> |
#define MAXCNTX 1023 /* maximum context length */ |
48 |
|
|
49 |
+ |
static char context[MAXCNTX+1]; /* current context path */ |
50 |
+ |
|
51 |
|
static VARDEF *hashtbl[NHASH]; /* definition list */ |
52 |
|
static int htndx; /* index for */ |
53 |
|
static VARDEF *htpos; /* ...dfirst() and */ |
200 |
|
cpp = context; /* start context with mark */ |
201 |
|
*cpp++ = CNTXMARK; |
202 |
|
do { /* carefully copy new context */ |
203 |
< |
if (cpp >= context+MAXWORD) |
203 |
> |
if (cpp >= context+MAXCNTX) |
204 |
|
break; /* just copy what we can */ |
205 |
|
if (isid(*ctx)) |
206 |
|
*cpp++ = *ctx++; |
220 |
|
char *ctx; |
221 |
|
{ |
222 |
|
extern char *strncpy(), *strcpy(); |
223 |
< |
char oldcontext[MAXWORD+1]; |
223 |
> |
char oldcontext[MAXCNTX+1]; |
224 |
|
register int n; |
225 |
|
|
226 |
|
strcpy(oldcontext, context); /* save old context */ |
227 |
|
setcontext(ctx); /* set new context */ |
228 |
|
n = strlen(context); /* tack on old */ |
229 |
< |
if (n+strlen(oldcontext) > MAXWORD) { |
230 |
< |
strncpy(context+n, oldcontext, MAXWORD-n); |
231 |
< |
context[MAXWORD] = '\0'; |
229 |
> |
if (n+strlen(oldcontext) > MAXCNTX) { |
230 |
> |
strncpy(context+n, oldcontext, MAXCNTX-n); |
231 |
> |
context[MAXCNTX] = '\0'; |
232 |
|
} else |
233 |
|
strcpy(context+n, oldcontext); |
234 |
|
return(context); |