diff options
author | kspillner | 2015-05-17 04:34:01 +0000 |
---|---|---|
committer | kspillner | 2015-05-17 04:34:01 +0000 |
commit | b7b7dc027b02665ffd0e32ed1ab04dbfa98b0a02 (patch) | |
tree | 77c4db19d45bb3ced8c303e4762bd90497f573e3 /conf.c | |
parent | 9a3c4b4f5a635f085257c5361bfa1de075afd6c0 (diff) | |
download | cwm-b7b7dc027b02665ffd0e32ed1ab04dbfa98b0a02.tar.gz |
Make window name and window class separate parameters to conf_autogroup.
No functional change, but will be used shortly.
ok okan@
Diffstat (limited to '')
-rw-r--r-- | conf.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.185 2015/03/26 21:41:43 okan Exp $ + * $OpenBSD: conf.c,v 1.186 2015/05/17 04:34:01 kspillner Exp $ */ #include <sys/types.h> @@ -71,19 +71,28 @@ conf_cmd_remove(struct conf *c, const char *name) } } void -conf_autogroup(struct conf *c, int num, const char *val) +conf_autogroup(struct conf *c, int num, const char *name, const char *class) { struct autogroupwin *aw; char *p; aw = xmalloc(sizeof(*aw)); - if ((p = strchr(val, ',')) == NULL) { - aw->name = NULL; - aw->class = xstrdup(val); + if ((p = strchr(class, ',')) == NULL) { + if (name == NULL) + aw->name = NULL; + else + aw->name = xstrdup(name); + + aw->class = xstrdup(class); } else { *(p++) = '\0'; - aw->name = xstrdup(val); + + if (name == NULL) + aw->name = xstrdup(class); + else + aw->name = xstrdup(name); + aw->class = xstrdup(p); } aw->num = num; |