Changeset 4099cf8


Ignore:
Timestamp:
Apr 19, 2007, 1:04:43 PM (17 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4228f8b
Parents:
d754b0a
Message:
When generating filters, change single quotes and double quotes into
dots, so they line parser doesn't choke on them.

This fixes problems smart-narrowing to instances such as "this'll break it".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rc2c5c77 r4099cf8  
    26532653  /* downcase it */
    26542654  downstr(filtname);
    2655   /* turn spaces into dots */
     2655  /* turn spaces, single quotes, and double quotes into dots */
    26562656  owl_text_tr(filtname, ' ', '.');
     2657  owl_text_tr(filtname, '\'', '.');
     2658  owl_text_tr(filtname, '"', '.');
    26572659 
    26582660  /* if it already exists then go with it.  This lets users override */
     
    26642666  tmpclass=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    26652667  owl_text_tr(tmpclass, ' ', '.');
     2668  owl_text_tr(tmpclass, '\'', '.');
     2669  owl_text_tr(tmpclass, '"', '.');
    26662670  if (instance) {
    26672671    tmpinstance=owl_text_quote(instance, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    26682672    owl_text_tr(tmpinstance, ' ', '.');
     2673    owl_text_tr(tmpinstance, '\'', '.');
     2674    owl_text_tr(tmpinstance, '"', '.');
    26692675  }
    26702676  len = strlen(tmpclass);
     
    30853091    quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    30863092    owl_text_tr(quoted, ' ', '.');
     3093    owl_text_tr(quoted, '\'', '.');
     3094    owl_text_tr(quoted, '"', '.');
    30873095    sprintf(buff, "%s ^(un)*%s(\\.d)*$", buff, quoted);
    30883096    owl_free(quoted);
     
    30933101    quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    30943102    owl_text_tr(quoted, ' ', '.');
     3103    owl_text_tr(quoted, '\'', '.');
     3104    owl_text_tr(quoted, '"', '.');
    30953105    sprintf(buff, "%s and instance ^(un)*%s(\\.d)*$", buff, quoted);
    30963106    owl_free(quoted);
     
    30993109    quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    31003110    owl_text_tr(quoted, ' ', '.');
     3111    owl_text_tr(quoted, '\'', '.');
     3112    owl_text_tr(quoted, '"', '.');
    31013113    sprintf(buff, "%s and recipient ^%s$", buff, quoted);
    31023114    owl_free(quoted);
Note: See TracChangeset for help on using the changeset viewer.