Changeset d222c44
- Timestamp:
- Jan 2, 2011, 3:35:15 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 719119de
- Parents:
- 2bc6ad35
- git-author:
- David Benjamin <davidben@mit.edu> (12/14/10 23:53:38)
- git-committer:
- David Benjamin <davidben@mit.edu> (01/02/11 15:35:15)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
filterelement.c
ra1d98e4 rd222c44 139 139 static void owl_filterelement_print_re(const owl_filterelement *fe, GString *buf) 140 140 { 141 const char *re , *q;141 const char *re; 142 142 g_string_append(buf, fe->field); 143 143 g_string_append(buf, " "); 144 144 145 145 re = owl_regex_get_string(&(fe->re)); 146 q = owl_getquoting(re); 147 g_string_append(buf, q); 148 g_string_append(buf, re); 149 g_string_append(buf, q); 146 owl_string_append_quoted_arg(buf, re); 150 147 } 151 148 … … 153 150 { 154 151 g_string_append(buf, "filter "); 155 g_string_append(buf, fe->field);152 owl_string_append_quoted_arg(buf, fe->field); 156 153 } 157 154 … … 159 156 { 160 157 g_string_append(buf, "perl "); 161 g_string_append(buf, fe->field);158 owl_string_append_quoted_arg(buf, fe->field); 162 159 } 163 160 -
functions.c
r1279f21 rd222c44 1632 1632 1633 1633 owl_function_popless_text(str->str); 1634 g_string_free(str, TRUE);1634 g_string_free(str, true); 1635 1635 } 1636 1636 … … 2492 2492 static char *owl_function_smartfilter_cc(const owl_message *m) { 2493 2493 const char *ccs; 2494 char *ccs_quoted; 2494 2495 char *filtname; 2495 char *text;2496 2496 owl_filter *f; 2497 GString *buf; 2497 2498 2498 2499 ccs = owl_message_get_attribute_value(m, "zephyr_ccs"); … … 2505 2506 } 2506 2507 2507 text = owl_sprintf("type ^zephyr$ and filter personal and " 2508 "zephyr_ccs ^%s%s%s$", 2509 owl_getquoting(ccs), ccs, owl_getquoting(ccs)); 2510 2511 f = owl_filter_new_fromstring(filtname, text); 2508 buf = g_string_new("type ^zephyr$ and filter personal and " 2509 "zephyr_ccs ^"); 2510 ccs_quoted = owl_text_quote(ccs, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2511 owl_string_append_quoted_arg(buf, ccs_quoted); 2512 g_string_append_c(buf, '$'); 2513 owl_free(ccs_quoted); 2514 2515 f = owl_filter_new_fromstring(filtname, buf->str); 2516 g_string_free(buf, true); 2512 2517 2513 2518 owl_global_add_filter(&g, f); 2514 2515 owl_free(text);2516 2519 2517 2520 return filtname; … … 2611 2614 const owl_view *v; 2612 2615 const owl_message *m; 2613 const char * cmdprefix, *mclass, *minst;2614 char *cmd;2616 const char *mclass, *minst; 2617 GString *buf; 2615 2618 2616 2619 v=owl_global_get_current_view(&g); … … 2638 2641 mclass, minst); 2639 2642 } else { 2640 cmdprefix = "start-command zpunt "; 2641 cmd = owl_malloc(strlen(cmdprefix)+strlen(mclass)+strlen(minst)+10); 2642 strcpy(cmd, cmdprefix); 2643 strcat(cmd, owl_getquoting(mclass)); 2644 strcat(cmd, mclass); 2645 strcat(cmd, owl_getquoting(mclass)); 2643 buf = g_string_new("start-command zpunt "); 2644 owl_string_append_quoted_arg(buf, mclass); 2646 2645 if (type) { 2647 strcat(cmd, " "); 2648 strcat(cmd, owl_getquoting(minst)); 2649 strcat(cmd, minst); 2650 strcat(cmd, owl_getquoting(minst)); 2646 g_string_append_c(buf, ' '); 2647 owl_string_append_quoted_arg(buf, minst); 2651 2648 } else { 2652 strcat(cmd, " *");2653 } 2654 owl_function_command( cmd);2655 owl_free(cmd);2649 g_string_append(buf, " *"); 2650 } 2651 owl_function_command(buf->str); 2652 g_string_free(buf, true); 2656 2653 } 2657 2654 } -
global.c
r8510d5b rd222c44 710 710 { 711 711 char *sn_escaped; 712 const char *quote;713 712 g->aim_loggedin=1; 714 713 if (g->aim_screenname) owl_free(g->aim_screenname); … … 716 715 g->aim_screenname=owl_strdup(screenname); 717 716 sn_escaped = owl_text_quote(screenname, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 718 quote = owl_getquoting(sn_escaped); 719 g->aim_screenname_for_filters=owl_sprintf("%s%s%s", quote, sn_escaped, quote); 717 g->aim_screenname_for_filters = owl_arg_quote(sn_escaped); 720 718 owl_free(sn_escaped); 721 719 } -
text.c
r72ec874 rd222c44 262 262 } 263 263 return(1); 264 }265 266 const char *owl_getquoting(const char *line)267 {268 if (line[0]=='\0') return("'");269 if (strchr(line, '\'')) return("\"");270 if (strchr(line, '"')) return("'");271 if (strcspn(line, "\n\t ") != strlen(line)) return("'");272 return("");273 264 } 274 265
Note: See TracChangeset
for help on using the changeset viewer.