From 45d36ff64cf80cea3f58b9591b52a6bfddfa01f1 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 11 Mar 2009 15:33:43 -0700 Subject: [PATCH] config: search in global section by default --- src/cconf.cc | 10 ++++++++-- src/config.cc | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/cconf.cc b/src/cconf.cc index 0fbba7fdedfab..2760132a1f1a8 100644 --- a/src/cconf.cc +++ b/src/cconf.cc @@ -12,6 +12,14 @@ using namespace std; #include "config.h" #include "common/ConfUtils.h" + +const char *id = NULL, *type = NULL; +char *name, *alt_name; + +char *post_process_val(char *val) +{ +} + void usage() { cerr << "usage: cconf <-c filename> [-t type] [-i id] [-l|--list_sections ] [-s
] [[-s section] ... ] [default]" << std::endl; @@ -25,8 +33,6 @@ int main(int argc, const char **argv) const char *list_sections = 0; char *val; int param = 0; - const char *id = NULL, *type = NULL; - char *name, *alt_name; deque args; deque sections; argv_to_deq(argc, argv, args); diff --git a/src/config.cc b/src/config.cc index 63237b966aa8d..09ad5b2394710 100644 --- a/src/config.cc +++ b/src/config.cc @@ -743,7 +743,7 @@ void parse_config_file(ConfFile *cf, bool auto_update, const char *module_type, cf->parse(); for (int i=0; isection; + if (section) + break; + default: + s = 3; + section = "global"; } switch (opt->type) { -- 2.39.5