Changeset 5bb6c21


Ignore:
Timestamp:
Jun 27, 2003, 9:16:44 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
dff8d8a
Parents:
1d3e925
Message:
Fixed bug that caused a crash on zpunt with '*' for an instance
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    re7cc1c3 r5bb6c21  
    77        Special cased replies for webzephyr users on classes and
    88          login notifications for webzephyr users
     9        Fixed bug that caused a crash on zpunt with '*' for an instance
    910       
    10112.0.4
  • functions.c

    r1d3e925 r5bb6c21  
    25842584}
    25852585
     2586/* add the given class, inst, recip to the punt list for filtering.
     2587 *   if direction==0 then punt
     2588 *   if direction==1 then unpunt
     2589 */
    25862590void owl_function_zpunt(char *class, char *inst, char *recip, int direction)
    25872591{
    2588   /* add the given class, inst, recip to the punt list for filtering.
    2589    *   if direction==0 then punt
    2590    *   if direction==1 then unpunt */
    25912592  owl_filter *f;
    25922593  owl_list *fl;
     
    25992600  f=malloc(sizeof(owl_filter));
    26002601  buff=malloc(strlen(class)+strlen(inst)+strlen(recip)+100);
    2601   if (!strcmp(recip, "*")) {
    2602     sprintf(buff, "class ^%s$ and instance ^%s$", class, inst);
     2602  strcpy(buff, "class");
     2603  if (!strcmp(class, "*")) {
     2604    strcat(buff, " .*");
    26032605  } else {
    2604     sprintf(buff, "class ^%s$ and instance ^%s$ and recipient %s", class, inst, recip);
    2605   }
     2606    sprintf(buff, "%s ^%s$", buff, class);
     2607  }
     2608  if (!strcmp(inst, "*")) {
     2609    strcat(buff, " and instance .*");
     2610  } else {
     2611    sprintf(buff, "%s and instance ^%s$", buff, inst);
     2612  }
     2613  if (strcmp(recip, "*")) {
     2614    sprintf(buff, "%s and recipient ^%s$", buff, recip);
     2615  }
     2616 
    26062617  owl_function_debugmsg("About to filter %s", buff);
    26072618  ret=owl_filter_init_fromstring(f, "punt-filter", buff);
Note: See TracChangeset for help on using the changeset viewer.