summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
Diffstat (limited to 'group.c')
-rw-r--r--group.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/group.c b/group.c
index 0624098..d88484b 100644
--- a/group.c
+++ b/group.c
@@ -188,11 +188,12 @@ group_make_autogroup(struct conf *conf, char *class, int no)
 
 	if ((p = strchr(class, ',')) == NULL) {
 		aw->name = NULL;
+		aw->class = xstrdup(class);
 	} else {
 		*(p++) = '\0';
-		aw->name = xstrdup(p);
+		aw->name = xstrdup(class);
+		aw->class = xstrdup(p);
 	}
-	aw->class = xstrdup(class);
 	aw->num = no;
 
 	TAILQ_INSERT_TAIL(&conf->autogroupq, aw, entry);