Subversion Repositories wimsdev

Rev

Rev 10 | Rev 7158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 3840
Line 103... Line 103...
103
    char *buf, *pp, *pe;
103
    char *buf, *pp, *pe;
104
    long int l;
104
    long int l;
105
    f=fopen(fname,"r"); if(f==NULL) return;
105
    f=fopen(fname,"r"); if(f==NULL) return;
106
    fseek(f,0,SEEK_END); l=ftell(f); fseek(f,0,SEEK_SET);
106
    fseek(f,0,SEEK_END); l=ftell(f); fseek(f,0,SEEK_SET);
107
    if(l<=0) {fclose(f); return;}
107
    if(l<=0) {fclose(f); return;}
108
    buf=xmalloc(l+16); fread(buf,1,l,f); fclose(f); buf[l]=0;
108
    buf=xmalloc(l+16); (void)fread(buf,1,l,f); fclose(f); buf[l]=0;
109
    fcind=0;
109
    fcind=0;
110
    for(pp=buf; pp; pp=pe) {
110
    for(pp=buf; pp; pp=pe) {
111
        pe=strchr(pp,'\n'); if(pe!=NULL) *pe++=0;
111
        pe=strchr(pp,'\n'); if(pe!=NULL) *pe++=0;
112
        oneline(pp);
112
        oneline(pp);
113
    }
113
    }