From e22c6e05e9ebc6cce941762020c5710b8014677b Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 18 Mar 2011 20:17:47 +0100 Subject: Imported Upstream version 0.8.3.998 --- system-settings/plugins/ifupdown/interface_parser.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'system-settings/plugins/ifupdown/interface_parser.c') diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c index 4635db2c..9be853a4 100644 --- a/system-settings/plugins/ifupdown/interface_parser.c +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -51,6 +51,7 @@ void add_block(const char *type, const char* name) void add_data(const char *key,const char *data) { if_data *ret; + char *idx; // Check if there is a block where we can attach our data if (first == NULL) @@ -58,6 +59,11 @@ void add_data(const char *key,const char *data) ret = (if_data*) calloc(1,sizeof(struct _if_data)); ret->key = g_strdup(key); + // Normalize keys. Convert '_' to '-', as ifupdown accepts both variants. + // When querying keys via ifparser_getkey(), use '-'. + while ((idx = strrchr(ret->key, '_'))) { + *idx = '-'; + } ret->data = g_strdup(data); if (last->info == NULL) -- cgit 1.3.0-6-gf8a5