=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-split-window.c,v retrieving revision 1.23 retrieving revision 1.24 diff -c -r1.23 -r1.24 *** src/usr.bin/tmux/cmd-split-window.c 2011/02/10 12:12:14 1.23 --- src/usr.bin/tmux/cmd-split-window.c 2011/08/30 09:18:52 1.24 *************** *** 1,4 **** ! /* $OpenBSD: cmd-split-window.c,v 1.23 2011/02/10 12:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-split-window.c,v 1.24 2011/08/30 09:18:52 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 58,64 **** struct window *w; struct window_pane *wp, *new_wp = NULL; struct environ env; ! char *cmd, *cwd, *cause; const char *shell; u_int hlimit, paneidx; int size, percentage; --- 58,64 ---- struct window *w; struct window_pane *wp, *new_wp = NULL; struct environ env; ! char *cmd, *cwd, *cause, *new_cause; const char *shell; u_int hlimit, paneidx; int size, percentage; *************** *** 94,109 **** if (args_has(args, 'l')) { size = args_strtonum(args, 'l', 0, INT_MAX, &cause); if (cause != NULL) { ! ctx->error(ctx, "size %s", cause); xfree(cause); ! return (-1); } } else if (args_has(args, 'p')) { percentage = args_strtonum(args, 'p', 0, INT_MAX, &cause); if (cause != NULL) { ! ctx->error(ctx, "percentage %s", cause); xfree(cause); ! return (-1); } if (type == LAYOUT_TOPBOTTOM) size = (wp->sy * percentage) / 100; --- 94,111 ---- if (args_has(args, 'l')) { size = args_strtonum(args, 'l', 0, INT_MAX, &cause); if (cause != NULL) { ! xasprintf(&new_cause, "size %s", cause); xfree(cause); ! cause = new_cause; ! goto error; } } else if (args_has(args, 'p')) { percentage = args_strtonum(args, 'p', 0, INT_MAX, &cause); if (cause != NULL) { ! xasprintf(&new_cause, "percentage %s", cause); xfree(cause); ! cause = new_cause; ! goto error; } if (type == LAYOUT_TOPBOTTOM) size = (wp->sy * percentage) / 100;