Changeset 07235af
- Timestamp:
- Jan 5, 2011, 1:35:52 PM (14 years ago)
- Branches:
- release-1.7
- Children:
- 89caa97
- Parents:
- 74df3bc
- git-author:
- David Benjamin <davidben@mit.edu> (01/03/11 03:09:14)
- git-committer:
- David Benjamin <davidben@mit.edu> (01/05/11 13:35:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r74df3bc r07235af 2785 2785 void owl_function_zpunt(const char *class, const char *inst, const char *recip, int direction) 2786 2786 { 2787 char *puntexpr, *classexpr, *instexpr, *recipexpr;2787 GString *buf; 2788 2788 char *quoted; 2789 2789 2790 buf = g_string_new(""); 2790 2791 if (!strcmp(class, "*")) { 2791 classexpr = owl_sprintf("class .*");2792 g_string_append(buf, "class .*"); 2792 2793 } else { 2793 2794 quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2794 owl_text_tr(quoted, ' ', '.'); 2795 owl_text_tr(quoted, '\'', '.'); 2796 owl_text_tr(quoted, '"', '.'); 2797 classexpr = owl_sprintf("class ^(un)*%s(\\.d)*$", quoted); 2795 owl_string_appendf_quoted(buf, "class ^(un)*%q(\\.d)*$", quoted); 2798 2796 owl_free(quoted); 2799 2797 } 2800 2798 if (!strcmp(inst, "*")) { 2801 instexpr = owl_sprintf(" and instance .*");2799 g_string_append(buf, " and instance .*"); 2802 2800 } else { 2803 2801 quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2804 owl_text_tr(quoted, ' ', '.'); 2805 owl_text_tr(quoted, '\'', '.'); 2806 owl_text_tr(quoted, '"', '.'); 2807 instexpr = owl_sprintf(" and instance ^(un)*%s(\\.d)*$", quoted); 2802 owl_string_appendf_quoted(buf, " and instance ^(un)*%q(\\.d)*$", quoted); 2808 2803 owl_free(quoted); 2809 2804 } 2810 2805 if (!strcmp(recip, "*")) { 2811 recipexpr = owl_sprintf("");2806 /* g_string_append(buf, ""); */ 2812 2807 } else { 2813 2808 if(!strcmp(recip, "%me%")) { … … 2815 2810 } 2816 2811 quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2817 owl_text_tr(quoted, ' ', '.'); 2818 owl_text_tr(quoted, '\'', '.'); 2819 owl_text_tr(quoted, '"', '.'); 2820 recipexpr = owl_sprintf(" and recipient ^%s$", quoted); 2812 owl_string_appendf_quoted(buf, " and recipient ^%q$", quoted); 2821 2813 owl_free(quoted); 2822 2814 } 2823 2815 2824 puntexpr = owl_sprintf("%s %s %s", classexpr, instexpr, recipexpr); 2825 owl_function_punt(puntexpr, direction); 2826 owl_free(puntexpr); 2827 owl_free(classexpr); 2828 owl_free(instexpr); 2829 owl_free(recipexpr); 2816 owl_function_punt(buf->str, direction); 2817 g_string_free(buf, true); 2830 2818 } 2831 2819
Note: See TracChangeset
for help on using the changeset viewer.