[PATCH] terminal: Fix unintended fallthrough to cursor restore

Derek Foreman derekf at osg.samsung.com
Thu Apr 5 15:34:07 UTC 2018


On 2018-04-03 01:38 PM, Daniel Stone wrote:
> ef57a9b788 added support for window operations such as reporting the
> title in escape mode. It implemented this by which-window-op case,
> inside the existing which-escape-code case. Whilst it would break out of
> the former window-op case, it never broke out of the latter escape-code
> case. This would lead to window ops (such as reporting title) falling
> through to restoring the saved cursor position.
> 
> This doesn't seem at all right, and also fixes a warning with GCC 8.

Wow, that's been broken a while.

Seems obviously correct to me
Reviewed-by: Derek Foreman <derekf at osg.samsung.com>

And pushed.

Thanks,
Derek

> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  clients/terminal.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/clients/terminal.c b/clients/terminal.c
> index 16a449540..f792badcd 100644
> --- a/clients/terminal.c
> +++ b/clients/terminal.c
> @@ -1686,6 +1686,7 @@ handle_escape(struct terminal *terminal)
>  				fprintf(stderr, "Unimplemented windowOp %d\n", args[0]);
>  			break;
>  		}
> +		break;
>  	case 'u':    /* Restore cursor location */
>  		terminal->row = terminal->saved_row;
>  		terminal->column = terminal->saved_column;
> 



More information about the wayland-devel mailing list