]> Pileus Git - lackey/blobdiff - src/conf.c
Fix bug when adding new config groups
[lackey] / src / conf.c
index 5d59d22e29c983fe39b01e122236521d70e71ca9..740932afcfb5f6a85ed8082602998f98f36498c0 100644 (file)
@@ -103,10 +103,10 @@ static void set_value(const char *group, const char *name,
        if (groupend) {
                /* Append to group */
                line_t *line = new0(line_t);
-               groupend->next = line;
                line->key      = strcopy(key);
                line->value    = strcopy(value);
                line->next     = groupend->next;
+               groupend->next = line;
        } else if (fileend)  {
                /* Create new group */
                line_t *blank  = new0(line_t);