Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
e7198f49
Commit
e7198f49
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: elide an unneeded intermediate variable
parent
125cc0cd
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+7
-11
src/winio.c
with
7 additions
and
11 deletions
+7
-11
src/winio.c
View file @
e7198f49
...
...
@@ -1501,30 +1501,26 @@ long get_unicode_kbinput(WINDOW *win, int kbinput)
* character into its corresponding control character. */
int
get_control_kbinput
(
int
kbinput
)
{
int
retval
;
/* Ctrl-Space (Ctrl-2, Ctrl-@, Ctrl-`) */
if
(
kbinput
==
' '
||
kbinput
==
'2'
)
ret
val
=
0
;
ret
urn
0
;
/* Ctrl-/ (Ctrl-7, Ctrl-_) */
else
if
(
kbinput
==
'/'
)
ret
val
=
31
;
ret
urn
31
;
/* Ctrl-3 (Ctrl-[, Esc) to Ctrl-7 (Ctrl-/, Ctrl-_) */
else
if
(
'3'
<=
kbinput
&&
kbinput
<=
'7'
)
ret
val
=
kbinput
-
24
;
ret
urn
kbinput
-
24
;
/* Ctrl-8 (Ctrl-?) */
else
if
(
kbinput
==
'8'
||
kbinput
==
'?'
)
ret
val
=
DEL_CODE
;
ret
urn
DEL_CODE
;
/* Ctrl-@ (Ctrl-Space, Ctrl-2, Ctrl-`) to Ctrl-_ (Ctrl-/, Ctrl-7) */
else
if
(
'@'
<=
kbinput
&&
kbinput
<=
'_'
)
ret
val
=
kbinput
-
'@'
;
ret
urn
kbinput
-
'@'
;
/* Ctrl-` (Ctrl-2, Ctrl-Space, Ctrl-@) to Ctrl-~ (Ctrl-6, Ctrl-^) */
else
if
(
'`'
<=
kbinput
&&
kbinput
<=
'~'
)
ret
val
=
kbinput
-
'`'
;
ret
urn
kbinput
-
'`'
;
else
retval
=
kbinput
;
return
retval
;
return
kbinput
;
}
/* Read in a stream of characters verbatim, and return the length of the
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help