Subversion Repositories wimsdev

Rev

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

Rev 8880 Rev 10200
Line 184... Line 184...
184
}
184
}
185
 
185
 
186
/* search for string, skipping parentheses */
186
/* search for string, skipping parentheses */
187
char *strparstr(char *p, char *fnd)
187
char *strparstr(char *p, char *fnd)
188
{
188
{
189
    char *pp, c;
189
    char *pp, c=*fnd;
190
    int n;
190
    size_t n = strlen(fnd);
191
 
-
 
192
    if(*fnd==0) return p+strlen(p);
191
    /*if(*fnd==0) return p+strlen(p);*/
193
    c=*fnd; n=strlen(fnd);
-
 
194
    for(pp=p;pp-1!=NULL && *pp!=0; pp++) {
192
    for(pp=p; *pp; pp++) {
195
      if(*pp==c && (n==1 || strncmp(pp,fnd,n)==0)) return pp;
193
      if(*pp==c && (n==1 || strncmp(pp,fnd,n)==0)) return pp;
196
      switch(*pp) {
194
      switch(*pp) {
197
          case '(': pp=find_matching(pp+1,')'); break;
195
          case '(': pp=find_matching(pp+1,')'); break;
198
          case '[': pp=find_matching(pp+1,']'); break;
196
          case '[': pp=find_matching(pp+1,']'); break;
199
          case '{': pp=find_matching(pp+1,'}'); break;
197
          case '{': pp=find_matching(pp+1,'}'); break;
200
      }
198
      }
-
 
199
      if (!pp) { pp = strstr(p,fnd); if (!pp) pp = p+strlen(p); break; }
201
    }
200
    }
202
    if(pp-1==NULL) pp=strstr(p,fnd);
-
 
203
    if(pp!=NULL) return pp;
201
    return pp;
204
    else return p+strlen(p);
-
 
205
}
202
}
206
 
203
 
207
/* Points to the end of an item */
204
/* Points to the end of an item */
208
char *find_item_end(char *p)
205
char *find_item_end(char *p)
209
{
206
{