| From b00b8332ab19e41c75ce143f45ab4585502c020b Mon Sep 17 00:00:00 2001 |
| From: Logan Rathbone <poprocks@gmail.com> |
| Date: Tue, 24 Oct 2023 14:06:04 -0400 |
| Subject: [PATCH] gtkhex: Local variables in switch statement should be in own |
| scope |
| |
| Fixes: #74 |
| |
| Thanks to: David C. Manuelda |
| |
| Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/ghex/-/commit/b00b8332ab19e41c75ce143f45ab4585502c020b] |
| --- |
| src/gtkhex.c | 4 ++++ |
| 1 file changed, 4 insertions(+) |
| |
| diff --git a/src/gtkhex.c b/src/gtkhex.c |
| index b401cd9..18e0433 100644 |
| --- a/src/gtkhex.c |
| +++ b/src/gtkhex.c |
| @@ -1941,6 +1941,7 @@ key_press_cb (GtkEventControllerKey *controller, |
| break; |
| |
| case GDK_KEY_Home: |
| + { |
| gint64 line_beg = self->cursor_pos; |
| |
| while (line_beg % self->cpl != 0) |
| @@ -1948,9 +1949,11 @@ key_press_cb (GtkEventControllerKey *controller, |
| |
| hex_widget_set_cursor (self, line_beg); |
| ret = GDK_EVENT_STOP; |
| + } |
| break; |
| |
| case GDK_KEY_End: |
| + { |
| gint64 line_end = self->cursor_pos; |
| |
| while (line_end % self->cpl != self->cpl - 1) |
| @@ -1958,6 +1961,7 @@ key_press_cb (GtkEventControllerKey *controller, |
| |
| hex_widget_set_cursor (self, MIN (line_end, payload_size)); |
| ret = GDK_EVENT_STOP; |
| + } |
| break; |
| |
| default: |
| -- |
| 2.42.0 |
| |