diff options
| author | Michael Biebl <biebl@debian.org> | 2011-03-18 20:18:01 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-03-18 20:18:01 +0100 |
| commit | 7638c999f0a44ad6c1734d53ad3d057cbaf04273 (patch) | |
| tree | a3b60d74304f5717135fa7f430a52c4519be6b39 /system-settings/plugins/ifupdown/interface_parser.c | |
| parent | 3d5624f02b77c669786cd29dc942dfe78b77ec81 (diff) | |
| parent | e22c6e05e9ebc6cce941762020c5710b8014677b (diff) | |
Merge commit 'upstream/0.8.3.998'
Diffstat (limited to 'system-settings/plugins/ifupdown/interface_parser.c')
| -rw-r--r-- | system-settings/plugins/ifupdown/interface_parser.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) |