=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/layout-custom.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/tmux/layout-custom.c 2011/06/05 10:53:05 1.2 +++ src/usr.bin/tmux/layout-custom.c 2012/01/30 20:57:02 1.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: layout-custom.c,v 1.2 2011/06/05 10:53:05 nicm Exp $ */ +/* $OpenBSD: layout-custom.c,v 1.3 2012/01/30 20:57:02 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -79,8 +79,13 @@ if (len == 0) return (-1); - tmplen = xsnprintf(tmp, sizeof tmp, - "%ux%u,%u,%u", lc->sx, lc->sy, lc->xoff, lc->yoff); + if (lc->wp != NULL) { + tmplen = xsnprintf(tmp, sizeof tmp, "%ux%u,%u,%u,%u", + lc->sx, lc->sy, lc->xoff, lc->yoff, lc->wp->id); + } else { + tmplen = xsnprintf(tmp, sizeof tmp, "%ux%u,%u,%u", + lc->sx, lc->sy, lc->xoff, lc->yoff); + } if (tmplen > (sizeof tmp) - 1) return (-1); if (strlcat(buf, tmp, len) >= len) @@ -202,7 +207,8 @@ if (!isdigit((u_char) **layout)) return (NULL); - if (sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4) + if (sscanf(*layout, "%ux%u,%u,%u,%*u", &sx, &sy, &xoff, &yoff) != 5 && + sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4) return (NULL); while (isdigit((u_char) **layout)) @@ -222,6 +228,11 @@ (*layout)++; while (isdigit((u_char) **layout)) (*layout)++; + if (**layout == ',') { + (*layout)++; + while (isdigit((u_char) **layout)) + (*layout)++; + } lc = layout_create_cell(lcparent); lc->sx = sx;