Rev 3718 | Rev 6876 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3718 | Rev 3840 | ||
---|---|---|---|
Line 300... | Line 300... | ||
300 | FILE *f; |
300 | FILE *f; |
301 | s=getenv("translator_input"); if(s==NULL || *s==0) return 0; |
301 | s=getenv("translator_input"); if(s==NULL || *s==0) return 0; |
302 | f=fopen(s,"r"); if(f==NULL) return 0; /* no file */ |
302 | f=fopen(s,"r"); if(f==NULL) return 0; /* no file */ |
303 | fseek(f,0,SEEK_END); l=ftell(f); fseek(f,0,SEEK_SET); |
303 | fseek(f,0,SEEK_END); l=ftell(f); fseek(f,0,SEEK_SET); |
304 | if(l<=0 || l>sourcelim) return 0; /* too long */ |
304 | if(l<=0 || l>sourcelim) return 0; /* too long */ |
305 | inpbuf=xmalloc(l+16); fread(inpbuf,1,l,f); fclose(f); inpbuf[l]=0; |
305 | inpbuf=xmalloc(l+16); (void)fread(inpbuf,1,l,f); fclose(f); inpbuf[l]=0; |
306 | } |
306 | } |
307 | p1=inpbuf; prepare_dic(); |
307 | p1=inpbuf; prepare_dic(); |
308 | if(leaveline) c='\n'; else c=' '; |
308 | if(leaveline) c='\n'; else c=' '; |
309 | do { |
309 | do { |
310 | l=strlen(p1); |
310 | l=strlen(p1); |