Changeset c894c15
- Timestamp:
- Feb 11, 2009, 12:20:21 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 99b50a5
- Parents:
- a0e6082
- git-author:
- Nelson Elhage <nelhage@mit.edu> (02/10/09 18:43:23)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (02/11/09 12:20:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
ra0e6082 rc894c15 2844 2844 void owl_function_zpunt(char *class, char *inst, char *recip, int direction) 2845 2845 { 2846 char * buff;2846 char *puntexpr, *classexpr, *instexpr, *recipexpr; 2847 2847 char *quoted; 2848 2848 2849 buff=owl_malloc(strlen(class)+strlen(inst)+strlen(recip)+100);2850 strcpy(buff, "class");2851 2849 if (!strcmp(class, "*")) { 2852 strcat(buff, ".*");2850 classexpr = owl_sprintf("class .*"); 2853 2851 } else { 2854 2852 quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); … … 2856 2854 owl_text_tr(quoted, '\'', '.'); 2857 2855 owl_text_tr(quoted, '"', '.'); 2858 sprintf(buff + strlen(buff), "^(un)*%s(\\.d)*$", quoted);2856 classexpr = owl_sprintf("class ^(un)*%s(\\.d)*$", quoted); 2859 2857 owl_free(quoted); 2860 2858 } 2861 2859 if (!strcmp(inst, "*")) { 2862 strcat(buff," and instance .*");2860 instexpr = owl_sprintf(" and instance .*"); 2863 2861 } else { 2864 2862 quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); … … 2866 2864 owl_text_tr(quoted, '\'', '.'); 2867 2865 owl_text_tr(quoted, '"', '.'); 2868 sprintf(buff + strlen(buff)," and instance ^(un)*%s(\\.d)*$", quoted);2866 instexpr = owl_sprintf(" and instance ^(un)*%s(\\.d)*$", quoted); 2869 2867 owl_free(quoted); 2870 2868 } 2871 if (strcmp(recip, "*")) { 2869 if (!strcmp(recip, "*")) { 2870 recipexpr = owl_sprintf(""); 2871 } else { 2872 2872 quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2873 2873 owl_text_tr(quoted, ' ', '.'); 2874 2874 owl_text_tr(quoted, '\'', '.'); 2875 2875 owl_text_tr(quoted, '"', '.'); 2876 sprintf(buff + strlen(buff)," and recipient ^%s$", quoted);2876 owl_sprintf(" and recipient ^%s$", quoted); 2877 2877 owl_free(quoted); 2878 2878 } 2879 2879 2880 owl_function_punt(buff, direction); 2881 owl_free(buff); 2880 puntexpr = owl_sprintf("%s %s %s", classexpr, instexpr, recipexpr); 2881 owl_function_punt(puntexpr, direction); 2882 owl_free(puntexpr); 2883 owl_free(classexpr); 2884 owl_free(instexpr); 2885 owl_free(recipexpr); 2882 2886 } 2883 2887
Note: See TracChangeset
for help on using the changeset viewer.