bc: placate compiler warnings
[oweals/busybox.git] / modutils / modprobe.c
index 2dac8a8953cf4bafe254d42cca0da727d3e04a82..0a372a049062aae973654203c62b9c3fb3a55fda 100644 (file)
@@ -8,7 +8,7 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 //config:config MODPROBE
-//config:      bool "modprobe (29 kb)"
+//config:      bool "modprobe (28 kb)"
 //config:      default y
 //config:      select PLATFORM_LINUX
 //config:      help
  */
 #define MODPROBE_OPTS  "alrDb"
 /* -a and -D _are_ in fact compatible */
-#define MODPROBE_COMPLEMENTARY ("q-v:v-q:l--arD:r--alD:a--lr:D--rl")
+#define MODPROBE_COMPLEMENTARY "q-v:v-q:l--arD:r--alD:a--lr:D--rl"
 //#define MODPROBE_OPTS  "acd:lnrt:C:b"
 //#define MODPROBE_COMPLEMENTARY "q-v:v-q:l--acr:a--lr:r--al"
 enum {
@@ -245,7 +245,7 @@ static int FAST_FUNC config_file_action(const char *filename,
        parser_t *p;
        struct module_entry *m;
        int rc = TRUE;
-       const char *base, *ext;
+       const char *base;
 
        /* Skip files that begin with a "." */
        base = bb_basename(filename);
@@ -266,8 +266,7 @@ static int FAST_FUNC config_file_action(const char *filename,
         * "include FILE_NOT_ENDING_IN_CONF" must work too.
         */
        if (depth != 0) {
-               ext = strrchr(base, '.');
-               if (ext == NULL || strcmp(ext + 1, "conf"))
+               if (!is_suffixed_with(base, ".conf"))
                        goto error;
        }
 
@@ -566,8 +565,10 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
 
        INIT_G();
 
-       opt_complementary = MODPROBE_COMPLEMENTARY;
-       opt = getopt32long(argv, INSMOD_OPTS MODPROBE_OPTS, modprobe_longopts INSMOD_ARGS);
+       opt = getopt32long(argv, "^" INSMOD_OPTS MODPROBE_OPTS "\0" MODPROBE_COMPLEMENTARY,
+                       modprobe_longopts
+                       INSMOD_ARGS
+       );
        argv += optind;
 
        /* Goto modules location */