This patch fixes the issue #2802 (https://github.com/i3/i3/issues/2802).
1). Revise the state machine for the 'rename workspace' command.
These scenarios are considered:
a). 'rename workspace to to bla'
state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO -> RENAME_WORKSPACE_LIKELY_TO_NEW_NAME
b). 'rename workspace to tosomething'
state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
c). 'rename workspace to to'
state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
d). 'rename workspace to bla'
state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
e). 'rename workspace bla to foo'
state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_TO -> RENAME_WORKSPACE_TO_NEW_NAME
2). Add a test case in 117-workspace.t for the scenario b.
The corresponding command is 'rename workspace to <name>'. As a side-effect
this fixes the command 'rename workspace 1 to to'.
Signed-off-by: Michael Walle <michael@walle.cc>
eval 'package foo; use strict;' enables strict within eval, it does
not leak into the surrounding scope.
Also fix various warnings/compile errors found due to now enabled
strict and warnings.