Commit 86cfaf66 authored by Rob Pike's avatar Rob Pike

reallocate library, libraryobj: 50 isn't nearly enough

R=rsc
DELTA=7  (2 added, 0 deleted, 5 changed)
OCL=35569
CL=35569
parent 6e4f9353
......@@ -153,9 +153,10 @@ addlib(char *src, char *obj)
for(i=0; i<libraryp; i++)
if(strcmp(name, library[i]) == 0)
return;
if(libraryp == nelem(library)){
diag("too many autolibs; skipping %s", name);
return;
if(libraryp == nlibrary){
nlibrary = 50 + 2*libraryp;
library = realloc(library, sizeof library[0] * nlibrary);
libraryobj = realloc(libraryobj, sizeof libraryobj[0] * nlibrary);
}
p = mal(strlen(name) + 1);
......
......@@ -36,9 +36,10 @@ extern int cout;
EXTERN char* INITENTRY;
EXTERN char thechar;
EXTERN char* thestring;
EXTERN char* library[50];
EXTERN char* libraryobj[50];
EXTERN char** library;
EXTERN char** libraryobj;
EXTERN int libraryp;
EXTERN int nlibrary;
EXTERN Sym* hash[NHASH];
EXTERN Sym* histfrog[MAXHIST];
EXTERN uchar fnuxi8[8];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment