Subversion Repositories wimsdev

Rev

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

Rev 13359 Rev 15414
Line 1237... Line 1237...
1237
 
1237
 
1238
/* return 1 if a word of bf2 is a substring of host
1238
/* return 1 if a word of bf2 is a substring of host
1239
 * and if time constraints are verified
1239
 * and if time constraints are verified
1240
 * Like checkhost, but check first time then host.
1240
 * Like checkhost, but check first time then host.
1241
 * The content of bf2[] is destroyed.
1241
 * The content of bf2[] is destroyed.
-
 
1242
 * it is possible to put a joker in the times
1242
 */
1243
 */
1243
int checkhostt(char bf2[])
1244
int checkhostt(char bf2[])
1244
{
1245
{
1245
  char *p1, *p2, *p3;
1246
  char *p1, *p2, *p3;
-
 
1247
  int i;
1246
  /* compare with starting time */
1248
  /* compare with starting time */
1247
  for(p1=strchr(bf2,'>'); p1!=NULL; p1=strchr(p1+1,'>')) {
1249
  for(p1=strchr(bf2,'>'); p1!=NULL; p1=strchr(p1+1,'>')) {
1248
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1250
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1249
    p3=find_word_start(++p1); p2=find_word_end(p3);
1251
    p3=find_word_start(++p1); p2=find_word_end(p3);
1250
    if(p2-p3!=14) continue;
1252
    if(p2-p3!=14) continue;
1251
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
1253
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
-
 
1254
    for (i=0; i<14; i++) if(p3[i]=='*') p3[i]=nowstr[i];
1252
    if(strncmp(nowstr,p3,14)<0) return 0;
1255
    if(strncmp(nowstr,p3,14)<0) return 0;
1253
    ovlstrcpy(p1-1,p2); p1-=2;
1256
    ovlstrcpy(p1-1,p2); p1-=2;
1254
  }
1257
  }
1255
  /* compare with ending time */
1258
  /* compare with ending time */
1256
  for(p1=strchr(bf2,'<'); p1!=NULL; p1=strchr(p1+1,'<')) {
1259
  for(p1=strchr(bf2,'<'); p1!=NULL; p1=strchr(p1+1,'<')) {
1257
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1260
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1258
    p3=find_word_start(++p1); p2=find_word_end(p3);
1261
    p3=find_word_start(++p1); p2=find_word_end(p3);
1259
    if(p2-p3!=14) continue;
1262
    if(p2-p3!=14) continue;
1260
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
1263
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
-
 
1264
    for (i=0; i<14; i++) if(p3[i]=='*') p3[i]=nowstr[i];
1261
    if(strncmp(nowstr,p3,14)>0) return 0;
1265
    if(strncmp(nowstr,p3,14)>0) return 0;
1262
    ovlstrcpy(p1-1,p2); p1-=2;
1266
    ovlstrcpy(p1-1,p2); p1-=2;
1263
  }
1267
  }
1264
  p1=find_word_start(bf2); if(*p1==0) return 1;
1268
  p1=find_word_start(bf2); if(*p1==0) return 1;
1265
  return checkhost(p1);
1269
  return checkhost(p1);