summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-07-21 20:23:08 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-07-21 20:23:08 +0200
commit34ba9fa9083c655e5ba06cecd46da157eb07d980 (patch)
tree0e0674306ce5aab0c4bb9058c417b0b1197369fe /src/config.c
parent6fda988f360b3145d5772b6964f336dd652357ea (diff)
Correctly handle the order of items
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 5904512..da1e5d1 100644
--- a/src/config.c
+++ b/src/config.c
@@ -60,6 +60,8 @@ int load_configuration(const char *configfile) {
SIMPLEQ_INSERT_TAIL(&batteries, new, batteries);
} OPT("color")
use_colors = true;
+ OPT("get_ipv6")
+ get_ipv6 = true;
OPT("get_ethspeed")
get_ethspeed = true;
OPT("get_cpu_temperature") {
@@ -108,7 +110,7 @@ int load_configuration(const char *configfile) {
}
OPT("order")
{
- #define SET_ORDER(opt, idx) { if (strcasecmp(token, opt) == 0) sprintf(order[idx], "%d", c++); }
+ #define SET_ORDER(opt, idx) { if (strcasecmp(token, opt) == 0) order[idx] = c++; }
char *walk, *token;
int c = 0;
walk = token = dest_value;
@@ -117,6 +119,7 @@ int load_configuration(const char *configfile) {
walk++;
*(walk++) = '\0';
SET_ORDER("run", ORDER_RUN);
+ SET_ORDER("ipv6", ORDER_IPV6);
SET_ORDER("wlan", ORDER_WLAN);
SET_ORDER("eth", ORDER_ETH);
SET_ORDER("battery", ORDER_BATTERY);