From 1fe2d902b89cad05f602f6fcb759b0129f7fd0ab Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 28 Oct 2023 10:18:43 +0300 Subject: [PATCH] (edit_cursor_to_eol): reduce variable scope. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index 708288d63..30485c116 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -902,8 +902,8 @@ edit_cursor_to_eol (WEdit * edit) static unsigned long my_type_of (int c) { - unsigned long x, r = 0; - const char *p, *q; + unsigned long r = 0; + const char *q; const char chars_move_whole_word[] = "!=&|<>^~ !:;, !'!`!.?!\"!( !) !{ !} !Aa0 !+-*/= |<> ![ !] !\\#! "; @@ -927,6 +927,9 @@ my_type_of (int c) return 0xFFFFFFFFUL; do { + unsigned long x; + const char *p; + for (x = 1, p = chars_move_whole_word; p < q; p++) if (*p == '!') x <<= 1;