]> mj.ucw.cz Git - libucw.git/commitdiff
Config: When cf_getopt() reports an error, do not commit config.
authorMartin Mares <mj@ucw.cz>
Wed, 4 Mar 2009 11:32:32 +0000 (12:32 +0100)
committerMartin Mares <mj@ucw.cz>
Wed, 4 Mar 2009 11:32:32 +0000 (12:32 +0100)
In such situations, the configuration sections need not be initialized
properly.

ucw/conf-input.c

index e0ef334de960f4151e508353007906050ef7d134..fed6a8282b45feb649ed7c2708289ac1f23beed0 100644 (file)
@@ -499,9 +499,10 @@ cf_getopt(int argc, char * const argv[], const char *short_opts, const struct op
 #endif
     } else {
       /* unhandled option or end of options */
-      if (res != ':' && res != '?')
+      if (res != ':' && res != '?') {
        load_default();
-      final_commit();
+       final_commit();
+      }
       other_options++;
       return res;
     }