blob: 61cd3b18094e891a03f58dfc25d2f95214a111a8 [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001From b00b8332ab19e41c75ce143f45ab4585502c020b Mon Sep 17 00:00:00 2001
2From: Logan Rathbone <poprocks@gmail.com>
3Date: Tue, 24 Oct 2023 14:06:04 -0400
4Subject: [PATCH] gtkhex: Local variables in switch statement should be in own
5 scope
6
7Fixes: #74
8
9Thanks to: David C. Manuelda
10
11Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/ghex/-/commit/b00b8332ab19e41c75ce143f45ab4585502c020b]
12---
13 src/gtkhex.c | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/src/gtkhex.c b/src/gtkhex.c
17index b401cd9..18e0433 100644
18--- a/src/gtkhex.c
19+++ b/src/gtkhex.c
20@@ -1941,6 +1941,7 @@ key_press_cb (GtkEventControllerKey *controller,
21 break;
22
23 case GDK_KEY_Home:
24+ {
25 gint64 line_beg = self->cursor_pos;
26
27 while (line_beg % self->cpl != 0)
28@@ -1948,9 +1949,11 @@ key_press_cb (GtkEventControllerKey *controller,
29
30 hex_widget_set_cursor (self, line_beg);
31 ret = GDK_EVENT_STOP;
32+ }
33 break;
34
35 case GDK_KEY_End:
36+ {
37 gint64 line_end = self->cursor_pos;
38
39 while (line_end % self->cpl != self->cpl - 1)
40@@ -1958,6 +1961,7 @@ key_press_cb (GtkEventControllerKey *controller,
41
42 hex_widget_set_cursor (self, MIN (line_end, payload_size));
43 ret = GDK_EVENT_STOP;
44+ }
45 break;
46
47 default:
48--
492.42.0
50