Subversion Repositories wimsdev

Rev

Rev 15775 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15775 Rev 16325
Line 56... Line 56...
56
  for(;*p;p++) {
56
  for(;*p;p++) {
57
    if(*p=='    ') *p=' ';
57
    if(*p=='    ') *p=' ';
58
    if(*p=='\n') *p='   ';
58
    if(*p=='\n') *p='   ';
59
  }
59
  }
60
}
60
}
-
 
61
/* non existent strings should not compare */
-
 
62
int my_strcmp(char *a, char *b) {return (a && b)? strcmp(a,b):1; }
61
 
63
 
62
/* variable substitution. buffer p must have MAX_LINELEN */
64
/* variable substitution. buffer p must have MAX_LINELEN */
63
void subst(char *p)
65
void subst(char *p)
64
{
66
{
65
  char *pp, *pe, nbuf[MAX_NAMELEN];
67
  char *pp, *pe, nbuf[MAX_NAMELEN];
Line 81... Line 83...
81
    }
83
    }
82
    if(!isalpha(*(pp+1))) continue;
84
    if(!isalpha(*(pp+1))) continue;
83
    for(pe=pp+1;isalnum(*pe) || *pe=='_'; pe++);
85
    for(pe=pp+1;isalnum(*pe) || *pe=='_'; pe++);
84
    if(pe-pp>=MAX_NAMELEN) continue;
86
    if(pe-pp>=MAX_NAMELEN) continue;
85
    memmove(nbuf,pp+1,pe-pp-1);nbuf[pe-pp-1]=0;
87
    memmove(nbuf,pp+1,pe-pp-1);nbuf[pe-pp-1]=0;
86
    for(i=varcnt-1;i>=1 && strcmp(nbuf,param[i].name)!=0;i--);
88
    for(i=varcnt-1;i>=1 && my_strcmp(nbuf,param[i].name)!=0;i--);
87
    if(i>=1) {
89
    if(i>=1) {
88
      if(deftag) param[i].save=1;
90
      if(deftag) param[i].save=1;
89
      if(*pe=='[') {
91
      if(*pe=='[') {
90
        char *pt, tbuf[MAX_LINELEN+1], vbuf[MAX_LINELEN+20];
92
        char *pt, tbuf[MAX_LINELEN+1], vbuf[MAX_LINELEN+20];
91
        int l;
93
        int l;