Subversion Repositories wimsdev

Rev

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

Rev 10200 Rev 10805
Line 415... Line 415...
415
char *fnd_line(char *p, int n, char bf[])
415
char *fnd_line(char *p, int n, char bf[])
416
{
416
{
417
    char *pp;
417
    char *pp;
418
    int i;
418
    int i;
419
 
419
 
-
 
420
    /*
420
    for(i=1,pp=p; pp-1!=NULL && *pp!=0 && i<n; pp=strchr(pp,'\n')+1, i++);
421
for(i=1,pp=p; pp-1!=NULL && *pp!=0 && i<n; pp=strchr(pp,'\n')+1, i++);
-
 
422
    */
421
    fnd_position=pp; if(pp-1==NULL) {
423
    for(i=1,pp=p; i<n; i++) {
-
 
424
        pp=strchr(pp,'\n');
-
 
425
        if (!pp++) {
422
      fnd_position=NULL; fnd_nextpos=""; *bf=0; return bf;
426
          fnd_position=NULL; fnd_nextpos=""; *bf=0; return bf;
-
 
427
        }
423
    }
428
    }
-
 
429
    fnd_position=pp;
424
    for(i=0; *(pp+i)!=0 && *(pp+i)!='\n'; i++) *(bf+i)=*(pp+i);
430
    for(i=0; *(pp+i)!=0 && *(pp+i)!='\n'; i++) *(bf+i)=*(pp+i);
425
    *(bf+i)=0;
431
    *(bf+i)=0;
426
    if(pp[i]=='\n') i++; fnd_nextpos=pp+i;
432
    if(pp[i]=='\n') i++;
-
 
433
    fnd_nextpos=pp+i;
427
    return bf;
434
    return bf;
428
}
435
}
429
 
436
 
430
/* find n-th item in list p, comma separated */
437
/* find n-th item in list p, comma separated */
431
char *fnd_item(char *p, int n, char bf[])
438
char *fnd_item(char *p, int n, char bf[])