Changeset 23fddad for functions.c
- Timestamp:
- Oct 23, 2009, 11:01:30 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 8590774
- Parents:
- 52761cc
- git-author:
- Karl Ramm <kcr@1ts.org> (09/30/09 10:12:27)
- git-committer:
- Karl Ramm <kcr@1ts.org> (10/23/09 23:01:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r52761cc r23fddad 2133 2133 owl_filter *f; 2134 2134 const owl_view *v; 2135 int ret, inuse=0;2135 int inuse = 0; 2136 2136 2137 2137 if (argc < 2) { … … 2183 2183 2184 2184 /* create the filter and check for errors */ 2185 f=owl_malloc(sizeof(owl_filter)); 2186 ret=owl_filter_init(f, argv[1], argc-2, argv+2); 2187 if (ret==-1) { 2188 owl_free(f); 2185 f = owl_filter_new(argv[1], argc-2, argv+2); 2186 if (f == NULL) { 2189 2187 owl_function_error("Invalid filter"); 2190 2188 return; … … 2382 2380 if (tmpinstance) owl_free(tmpinstance); 2383 2381 2384 f=owl_malloc(sizeof(owl_filter)); 2385 owl_filter_init_fromstring(f, filtname, argbuff); 2382 f = owl_filter_new_fromstring(filtname, argbuff); 2386 2383 2387 2384 /* add it to the global list */ … … 2421 2418 2422 2419 /* create the new-internal filter */ 2423 f=owl_malloc(sizeof(owl_filter));2424 2425 2420 esclonguser = owl_text_quote(longuser, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2426 2421 … … 2430 2425 esclonguser); 2431 2426 2432 owl_filter_init_fromstring(f,filtname, argbuff);2427 f = owl_filter_new_fromstring(filtname, argbuff); 2433 2428 2434 2429 /* add it to the global list */ … … 2465 2460 2466 2461 /* create the new-internal filter */ 2467 f=owl_malloc(sizeof(owl_filter));2468 2469 2462 escuser = owl_text_quote(user, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2470 2463 … … 2474 2467 escuser, owl_global_get_aim_screenname_for_filters(&g)); 2475 2468 2476 owl_filter_init_fromstring(f,filtname, argbuff);2469 f = owl_filter_new_fromstring(filtname, argbuff); 2477 2470 2478 2471 /* add it to the global list */ … … 2506 2499 argbuff = owl_sprintf("type ^%s$", esctype); 2507 2500 2508 owl_filter_init_fromstring(f,filtname, argbuff);2501 f = owl_filter_new_fromstring(filtname, argbuff); 2509 2502 2510 2503 /* add it to the global list */ … … 2825 2818 owl_filter *f; 2826 2819 owl_list *fl; 2827 int ret,i, j;2820 int i, j; 2828 2821 fl=owl_global_get_puntlist(&g); 2829 2822 2830 2823 /* first, create the filter */ 2831 f=owl_malloc(sizeof(owl_filter));2832 2833 2824 owl_function_debugmsg("About to filter %s", filter); 2834 ret=owl_filter_init_fromstring(f,"punt-filter", filter);2835 if ( ret) {2825 f = owl_filter_new_fromstring("punt-filter", filter); 2826 if (f == NULL) { 2836 2827 owl_function_error("Error creating filter for zpunt"); 2837 owl_filter_free(f);2838 owl_free(f);2839 2828 return; 2840 2829 } … … 2847 2836 /* if we're punting, then just silently bow out on this duplicate */ 2848 2837 if (direction==0) { 2849 owl_filter_free(f); 2850 owl_free(f); 2838 owl_filter_delete(f); 2851 2839 return; 2852 2840 } … … 2854 2842 /* if we're unpunting, then remove this filter from the puntlist */ 2855 2843 if (direction==1) { 2856 owl_filter_ free(owl_list_get_element(fl, i));2844 owl_filter_delete(owl_list_get_element(fl, i)); 2857 2845 owl_list_remove_element(fl, i); 2858 owl_filter_free(f); 2859 owl_free(f); 2846 owl_filter_delete(f); 2860 2847 return; 2861 2848 }
Note: See TracChangeset
for help on using the changeset viewer.