From 7094431d569523afbaf0b0e50e69bc785578131f Mon Sep 17 00:00:00 2001 From: tadam Date: Tue, 31 Aug 2010 07:05:06 +0000 Subject: [PATCH] Apply Move command-parsing patch (Gerard Vermeulen) This fixes the handling of: "w+-2 w+2p" -- that is, "+-" values are legal. --- ChangeLog | 4 ++++ fvwm/move_resize.c | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 89385186d..e921f61b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-08-31 Gerard Vermeulen + * fvwm/move_resize.c (GetOnePositionArgument): + Parse commands like 'Move w+-5p w+-2p'. + 2010-08-09 Thomas Adam * NEWS: * configure.ac: diff --git a/fvwm/move_resize.c b/fvwm/move_resize.c index 9902341f9..acb8bccf2 100644 --- a/fvwm/move_resize.c +++ b/fvwm/move_resize.c @@ -401,7 +401,19 @@ static int GetOnePositionArgument( float f; /* parse value */ - if (sscanf(s1, "%d%n", &val, &n) < 1) + if (sscanf(s1, "-%d%n", &val, &n) >= 1) + { + /* i.e. -1, -+1 or --1 */ + final_pos += (screen_size - window_size); + val = -val; + } + else if ( + sscanf(s1, "+%d%n", &val, &n) >= 1 || + sscanf(s1, "%d%n", &val, &n) >= 1) + { + /* i.e. 1, +1, ++1 or +-1 */ + } + else { /* syntax error, ignore rest of string */ break; -- 2.11.4.GIT