Changeset d222c44 for functions.c
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.