Rev 8863 | Rev 11124 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8863 | Rev 8898 | ||
---|---|---|---|
Line 121... | Line 121... | ||
121 | } |
121 | } |
122 | } |
122 | } |
123 | } |
123 | } |
124 | 124 | ||
125 | /* Prepare dictionary */ |
125 | /* Prepare dictionary */ |
126 | void |
126 | static void prepare_dict(void) |
127 | { |
127 | { |
128 | int i,l; |
128 | int i,l; |
129 | FILE *dicf; |
129 | FILE *dicf; |
130 | char *fname, *p1, *p2, *pp, buf[1024]; |
130 | char *fname, *p1, *p2, *pp, buf[1024]; |
131 | long int flen; |
131 | long int flen; |
Line 255... | Line 255... | ||
255 | f=fopen(s,"r"); if(f==NULL) return 0; /* no file */ |
255 | f=fopen(s,"r"); if(f==NULL) return 0; /* no file */ |
256 | fseek(f,0,SEEK_END); l=ftell(f); fseek(f,0,SEEK_SET); |
256 | fseek(f,0,SEEK_END); l=ftell(f); fseek(f,0,SEEK_SET); |
257 | if(l<=0 || l>sourcelim) return 0; /* too long */ |
257 | if(l<=0 || l>sourcelim) return 0; /* too long */ |
258 | inpbuf=xmalloc(l+16); (void)fread(inpbuf,1,l,f); fclose(f); inpbuf[l]=0; |
258 | inpbuf=xmalloc(l+16); (void)fread(inpbuf,1,l,f); fclose(f); inpbuf[l]=0; |
259 | } |
259 | } |
260 | p1=inpbuf; |
260 | p1=inpbuf; prepare_dict(); |
261 | if(leaveline) c='\n'; else c=' '; |
261 | if(leaveline) c='\n'; else c=' '; |
262 | do { |
262 | do { |
263 | l=strlen(p1); |
263 | l=strlen(p1); |
264 | if(l>MAX_LINELEN-1024) l=MAX_LINELEN-1024; p2=p1+l; |
264 | if(l>MAX_LINELEN-1024) l=MAX_LINELEN-1024; p2=p1+l; |
265 | if(*p2) { |
265 | if(*p2) { |