]> git.tuebingen.mpg.de Git - adu.git/commitdiff
parse_select_options(): Add missing break statements.
authorAndre Noll <maan@systemlinux.org>
Sat, 1 Nov 2008 21:41:01 +0000 (22:41 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 1 Nov 2008 21:41:01 +0000 (22:41 +0100)
Doooh. This bug caused that we always used the user_summary_atoms.

select.c

index 949fd92755a369c7a2c572a2a96a1e782055c82e..c09574efb198fe3971cefaaee1daa4b78ccfbea0 100644 (file)
--- a/select.c
+++ b/select.c
@@ -678,24 +678,34 @@ int parse_select_options(char *string, struct select_cmdline_parser_params *para
        if (ret < 0)
                return ret;
 
+       if (!fmt)
+               INFO_LOG("using default format string\n");
        switch (select_conf.select_mode_arg) {
                case select_mode_arg_global_list:
                        if (!fmt)
                                fmt = GLOBAL_LIST_DFLT_FMT;
                        atoms = global_list_atoms;
+                       break;
                case select_mode_arg_global_summary:
                        if (!fmt)
                                fmt = GLOBAL_SUMMARY_DFLT_FMT;
                        atoms = global_summary_atoms;
+                       break;
                case select_mode_arg_user_list:
                        if (!fmt)
                                fmt = USER_LIST_DFLT_FMT;
                        atoms = user_list_atoms;
+                       break;
                case select_mode_arg_user_summary:
                        if (!fmt)
                                fmt = USER_SUMMARY_DFLT_FMT;
                        atoms = user_summary_atoms;
+                       break;
+               default:
+                       ERROR_LOG("bad select mode\n");
+                       return -ERRNO_TO_ERROR(-EINVAL);
        };
+       INFO_LOG("format string: %s\n", fmt);
        return parse_format_string(fmt, atoms, fi);
 help:
        line = select_conf.detailed_help_given?