[apparmor] [patch] parser: fix --cache-loc short arg option (-L)

John Johansen john.johansen at canonical.com
Tue Feb 4 22:30:20 UTC 2014


On 02/04/2014 05:04 PM, Steve Beattie wrote:

And to go along with this, lets move the short options to be right next to
the long so its easier to update them together.

Index: b/parser/parser_main.c
===================================================================
--- a/parser/parser_main.c
+++ b/parser/parser_main.c
@@ -87,6 +87,8 @@
 /* per-profile settings */
 int force_complain = 0;
 
+/* Make sure to update BOTH the short and long_options */
+static const char *short_options = "adf:h::rRVvI:b:BCD:NSm:qQn:XKTWkL:O:po:";
 struct option long_options[] = {
        {"add",                 0, 0, 'a'},
        {"binary",              0, 0, 'B'},
@@ -583,7 +585,7 @@
        int count = 0;
        option = OPTION_ADD;
 
-       while ((c = getopt_long(argc, argv, "adf:h::rRVvI:b:BCD:NSm:qQn:XKTWkL:O:po:", long_options, &o)) != -1)
+       while ((c = getopt_long(argc, argv, short_options, long_options, &o)) != -1)
        {
                count += process_arg(c, optarg);
        }




More information about the AppArmor mailing list