]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - filter.c
Don't check return value of command line parsers unnecessarily.
[paraslash.git] / filter.c
index 8ef9ac1afa2db2860d12eec33c68f18581fbeb11..84ad8577120daf92c338a842e0567da91fa9968b 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -65,8 +65,7 @@ static int parse_config(int argc, char *argv[])
        static char *cf; /* config file */
        struct stat statbuf;
 
-       if (filter_cmdline_parser(argc, argv, &conf))
-               return -E_FILTER_SYNTAX;
+       filter_cmdline_parser(argc, argv, &conf);
        HANDLE_VERSION_FLAG("filter", conf);
        if (conf.help_given || conf.detailed_help_given)
                print_help_and_die();
@@ -84,8 +83,7 @@ static int parse_config(int argc, char *argv[])
                        .check_ambiguity = 0,
                        .print_errors = 1
                };
-               if (filter_cmdline_parser_config_file(cf, &conf, &params))
-                       return -E_FILTER_SYNTAX;
+               filter_cmdline_parser_config_file(cf, &conf, &params);
        }
        if (!conf.filter_given)
                return -E_NO_FILTERS;
@@ -161,13 +159,14 @@ out_cleanup:
                f = filters + fn->filter_num;
                if (f->close)
                        f->close(fn);
-               btr_free_node(fn->btrn);
-               free(fn->conf);
+               btr_remove_node(&fn->btrn);
+               if (f->free_config)
+                       f->free_config(fn->conf);
                free(fn);
        }
        free(fns);
-       btr_free_node(sit->btrn);
-       btr_free_node(sot->btrn);
+       btr_remove_node(&sit->btrn);
+       btr_remove_node(&sot->btrn);
 out:
        if (ret < 0)
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));