Changeset c7fe23e
- Timestamp:
- Jan 20, 2011, 7:59:38 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- b31252d
- Parents:
- 569f0bd
- git-author:
- David Benjamin <davidben@mit.edu> (01/02/11 19:37:28)
- git-committer:
- David Benjamin <davidben@mit.edu> (01/20/11 19:59:38)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
rd275eb2 rc7fe23e 2291 2291 } 2292 2292 filtname = owl_function_classinstfilt(argv[1], NULL, owl_global_is_narrow_related(&g)); 2293 owl_function_change_currentview_filter(filtname); 2294 owl_free(filtname); 2293 if (filtname) { 2294 owl_function_change_currentview_filter(filtname); 2295 owl_free(filtname); 2296 } 2295 2297 return NULL; 2296 2298 } … … 2304 2306 } 2305 2307 filtname=owl_function_zuserfilt(argv[1]); 2306 owl_function_change_currentview_filter(filtname); 2307 owl_free(filtname); 2308 if (filtname) { 2309 owl_function_change_currentview_filter(filtname); 2310 owl_free(filtname); 2311 } 2308 2312 return NULL; 2309 2313 } … … 2395 2399 char *owl_command_colorclass(int argc, const char *const *argv, const char *buff) 2396 2400 { 2397 c onst char *filtname;2401 char *filtname; 2398 2402 2399 2403 if (argc < 3 || argc > 4) { … … 2403 2407 2404 2408 filtname=owl_function_classinstfilt(argv[1], NULL, owl_global_is_narrow_related(&g)); 2405 (void) owl_function_color_filter(filtname, argv[2], (argc == 4 ? argv[3] : NULL)); 2409 if (filtname) { 2410 (void) owl_function_color_filter(filtname, argv[2], (argc == 4 ? argv[3] : NULL)); 2411 owl_free(filtname); 2412 } 2406 2413 return NULL; 2407 2414 } -
functions.c
rc23f678 rc7fe23e 2280 2280 /* Create a filter for a class, instance if one doesn't exist. If 2281 2281 * instance is NULL then catch all messgaes in the class. Returns the 2282 * name of the filter , which the caller must free.2282 * name of the filter or null. The caller must free this name. 2283 2283 * If 'related' is nonzero, encompass unclasses and .d classes as well. 2284 2284 */ … … 2348 2348 2349 2349 f = owl_filter_new_fromstring(filtname, argbuff); 2350 owl_free(argbuff); 2351 if (f == NULL) { 2352 /* Couldn't make a filter for some reason. Return NULL. */ 2353 owl_function_error("Error creating filter '%s'", filtname); 2354 owl_free(filtname); 2355 filtname = NULL; 2356 goto done; 2357 } 2350 2358 2351 2359 /* add it to the global list */ 2352 2360 owl_global_add_filter(&g, f); 2353 2361 2354 owl_free(argbuff);2355 2362 done: 2356 2363 owl_free(class); … … 2390 2397 "recipient ^%1$s$ ) ) ) or ( ( class ^login$ ) and ( sender ^%1$s$ ) )", 2391 2398 esclonguser); 2399 owl_free(esclonguser); 2392 2400 2393 2401 f = owl_filter_new_fromstring(filtname, argbuff); 2402 owl_free(argbuff); 2403 2404 if (f == NULL) { 2405 /* Couldn't make a filter for some reason. Return NULL. */ 2406 owl_function_error("Error creating filter '%s'", filtname); 2407 owl_free(filtname); 2408 return NULL; 2409 } 2394 2410 2395 2411 /* add it to the global list */ 2396 2412 owl_global_add_filter(&g, f); 2397 2398 /* free stuff */2399 owl_free(argbuff);2400 owl_free(esclonguser);2401 2413 2402 2414 return(filtname); … … 2430 2442 "( sender ^%2$s$ and recipient ^%1$s$ ) ) )", 2431 2443 escuser, owl_global_get_aim_screenname_for_filters(&g)); 2444 owl_free(escuser); 2432 2445 2433 2446 f = owl_filter_new_fromstring(filtname, argbuff); 2447 owl_free(argbuff); 2448 2449 if (f == NULL) { 2450 owl_function_error("Error creating filter '%s'", filtname); 2451 owl_free(filtname); 2452 return NULL; 2453 } 2434 2454 2435 2455 /* add it to the global list */ 2436 2456 owl_global_add_filter(&g, f); 2437 2438 /* free stuff */2439 owl_free(argbuff);2440 owl_free(escuser);2441 2457 2442 2458 return(filtname); … … 2460 2476 2461 2477 argbuff = owl_sprintf("type ^%s$", esctype); 2478 owl_free(esctype); 2462 2479 2463 2480 f = owl_filter_new_fromstring(filtname, argbuff); 2481 owl_free(argbuff); 2482 2483 if (f == NULL) { 2484 owl_function_error("Error creating filter '%s'", filtname); 2485 owl_free(filtname); 2486 return NULL; 2487 } 2464 2488 2465 2489 /* add it to the global list */ 2466 2490 owl_global_add_filter(&g, f); 2467 2468 /* free stuff */2469 owl_free(argbuff);2470 owl_free(esctype);2471 2491 2472 2492 return filtname; … … 2520 2540 f = owl_filter_new_fromstring(filtname, buf->str); 2521 2541 g_string_free(buf, true); 2542 2543 if (f == NULL) { 2544 owl_function_error("Error creating filter '%s'", filtname); 2545 owl_free(filtname); 2546 return NULL; 2547 } 2522 2548 2523 2549 owl_global_add_filter(&g, f);
Note: See TracChangeset
for help on using the changeset viewer.