Subversion Repositories wimsdev

Rev

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

Rev 12242 Rev 13011
Line 1233... Line 1233...
1233
    if(strstr(pp,lbuf)!=NULL) return 1;      /* found */
1233
    if(strstr(pp,lbuf)!=NULL) return 1;      /* found */
1234
  }
1234
  }
1235
  return 0;
1235
  return 0;
1236
}
1236
}
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
 * Like checkhost, but with time check.
1240
 * Like checkhost, but check first time then host.
1240
 * The content of bf2[] is destroyed.
1241
 * The content of bf2[] is destroyed.
1241
 */
1242
 */
1242
int checkhostt(char bf2[])
1243
int checkhostt(char bf2[])
1243
{
1244
{
1244
  char *p1, *p2, *p3;
1245
  char *p1, *p2, *p3;
1245
/* compare with starting time */
1246
  /* compare with starting time */
1246
  for(p1=strchr(bf2,'>'); p1!=NULL; p1=strchr(p1+1,'>')) {
1247
  for(p1=strchr(bf2,'>'); p1!=NULL; p1=strchr(p1+1,'>')) {
1247
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1248
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1248
    p3=find_word_start(++p1); p2=find_word_end(p3);
1249
    p3=find_word_start(++p1); p2=find_word_end(p3);
1249
    if(p2-p3!=14) continue;
1250
    if(p2-p3!=14) continue;
1250
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
1251
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
1251
    if(strncmp(nowstr,p3,14)<0) return 0;
1252
    if(strncmp(nowstr,p3,14)<0) return 0;
1252
    ovlstrcpy(p1-1,p2); p1-=2;
1253
    ovlstrcpy(p1-1,p2); p1-=2;
1253
  }
1254
  }
1254
/* compare with ending time */
1255
  /* compare with ending time */
1255
  for(p1=strchr(bf2,'<'); p1!=NULL; p1=strchr(p1+1,'<')) {
1256
  for(p1=strchr(bf2,'<'); p1!=NULL; p1=strchr(p1+1,'<')) {
1256
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1257
    if(p1>bf2 && !isspace(*(p1-1))) continue;
1257
    p3=find_word_start(++p1); p2=find_word_end(p3);
1258
    p3=find_word_start(++p1); p2=find_word_end(p3);
1258
    if(p2-p3!=14) continue;
1259
    if(p2-p3!=14) continue;
1259
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;
1260
    p3[8]='.'; p3[11]=':'; if(*p2) *p2++=0;