mirror of
https://github.com/tmux/tmux.git
synced 2026-10-08 19:14:20 +00:00
Do not count arguments starting - as optional arguments, makes old
resize-pane syntax work. GitHub issue 5275, based on a changed from Dane Jensen.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -63,8 +64,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
const char *errstr, *argval;
|
||||
const char flags[4] = { 'U', 'D', 'L', 'R' };
|
||||
char *cause = NULL, flag;
|
||||
u_int opposite = 0;
|
||||
int adjust, x, y, status;
|
||||
int adjust, x, y, status, opposite = 0;
|
||||
long unsigned i;
|
||||
struct grid *gd = wp->base.grid;
|
||||
|
||||
@@ -147,8 +147,12 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
continue;
|
||||
|
||||
argval = args_get(args, flag);
|
||||
if (argval == NULL)
|
||||
argval = "1";
|
||||
if (argval == NULL) {
|
||||
if (args_count(args) == 0)
|
||||
argval = "1";
|
||||
else
|
||||
argval = args_string(args, 0);
|
||||
}
|
||||
|
||||
adjust = strtonum(argval, INT_MIN, INT_MAX, &errstr);
|
||||
if (errstr != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user