diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-11 21:31:46 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-11 21:31:46 +0000 |
commit | 543420ccd2c3c23437405b391e3f9fe1d05223f7 (patch) | |
tree | 7581f8eb90cd26fd51c5e406f31f561e0e4eb603 /layout-custom.c | |
parent | 064022548bcbf4d45705fdbff8441f2b5da5f682 (diff) | |
parent | 7c009509676b4580065fdc6f0084a93b9758fac0 (diff) | |
download | rtmux-543420ccd2c3c23437405b391e3f9fe1d05223f7.tar.gz rtmux-543420ccd2c3c23437405b391e3f9fe1d05223f7.tar.bz2 rtmux-543420ccd2c3c23437405b391e3f9fe1d05223f7.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'layout-custom.c')
-rw-r--r-- | layout-custom.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/layout-custom.c b/layout-custom.c index c076232f..e32d9d9d 100644 --- a/layout-custom.c +++ b/layout-custom.c @@ -63,7 +63,7 @@ layout_dump(struct window *w) if (layout_append(w->layout_root, layout, sizeof layout) != 0) return (NULL); - xasprintf(&out, "%4x,%s", layout_checksum(layout), layout); + xasprintf(&out, "%04x,%s", layout_checksum(layout), layout); return (out); } @@ -206,11 +206,11 @@ layout_construct(struct layout_cell *lcparent, const char **layout) { struct layout_cell *lc, *lcchild; u_int sx, sy, xoff, yoff; + const char *saved; if (!isdigit((u_char) **layout)) return (NULL); - if (sscanf(*layout, "%ux%u,%u,%u,%*u", &sx, &sy, &xoff, &yoff) != 4 && - sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4) + if (sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4) return (NULL); while (isdigit((u_char) **layout)) @@ -231,9 +231,12 @@ layout_construct(struct layout_cell *lcparent, const char **layout) while (isdigit((u_char) **layout)) (*layout)++; if (**layout == ',') { + saved = *layout; (*layout)++; while (isdigit((u_char) **layout)) (*layout)++; + if (**layout == 'x') + *layout = saved; } lc = layout_create_cell(lcparent); |