Changeset bc08664


Ignore:
Timestamp:
Oct 26, 2003, 4:11:37 PM (20 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:
995eb4b
Parents:
e3d9c77
Message:
zpunt now works wtih weird regex characters
	CVS: ----------------------------------------------------------------------
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r25dd31a rbc08664  
    99        Added the 'loopwrite' command
    1010        Added a timestamp to the default style
     11        Zpunt now works with weird regex characters
    1112       
    12132.0.10
  • functions.c

    re3d9c77 rbc08664  
    26602660  }
    26612661
    2662   mclass = owl_message_get_class(m);
    2663   minst = owl_message_get_instance(m);
     2662  mclass = owl_text_quote(owl_message_get_class(m), OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     2663  minst = owl_text_quote(owl_message_get_instance(m), OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    26642664  if (!mclass || !*mclass || *mclass==' '
    26652665      || (!strcasecmp(mclass, "message") && !strcasecmp(minst, "personal"))
     
    26812681    owl_free(cmd);
    26822682  }
     2683  owl_free(mclass);
     2684  owl_free(minst);
    26832685}
    26842686
     
    27342736  owl_list *fl;
    27352737  char *buff;
     2738  char *quoted;
    27362739  int ret, i, j;
    27372740
     
    27452748    strcat(buff, " .*");
    27462749  } else {
    2747     sprintf(buff, "%s ^%s$", buff, class);
     2750    quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     2751    sprintf(buff, "%s ^%s$", buff, quoted);
     2752    owl_free(quoted);
    27482753  }
    27492754  if (!strcmp(inst, "*")) {
    27502755    strcat(buff, " and instance .*");
    27512756  } else {
    2752     sprintf(buff, "%s and instance ^%s$", buff, inst);
     2757    quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     2758    sprintf(buff, "%s and instance ^%s$", buff, quoted);
     2759    owl_free(quoted);
    27532760  }
    27542761  if (strcmp(recip, "*")) {
    2755     sprintf(buff, "%s and recipient ^%s$", buff, recip);
     2762    quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     2763    sprintf(buff, "%s and recipient ^%s$", buff, quoted);
     2764    owl_free(quoted);
    27562765  }
    27572766 
  • owl.h

    r25dd31a rbc08664  
    141141#define OWL_WEBZEPHYR_CLASS     "webzephyr"
    142142#define OWL_WEBZEPHYR_OPCODE    "webzephyr"
     143
     144#define OWL_REGEX_QUOTECHARS    "+*.?[]^\\"
     145#define OWL_REGEX_QUOTEWITH     "\\"
    143146
    144147#if defined(HAVE_DES_STRING_TO_KEY) && defined(HAVE_DES_KEY_SCHED) && defined(HAVE_DES_ECB_ENCRYPT)
  • regex.c

    re187445 rbc08664  
    3636  }
    3737
     38  return(0);
     39}
     40
     41int owl_regex_create_quoted(owl_regex *re, char *string)
     42{
     43  char *quoted;
     44 
     45  quoted=owl_text_quote(string, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     46  owl_regex_create(re, quoted);
     47  owl_free(quoted);
    3848  return(0);
    3949}
Note: See TracChangeset for help on using the changeset viewer.