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
8edaa38a
Commit
8edaa38a
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: condense two bits of code, and drop two asserts
parent
1f55c881
master
feature/match-parens
refactor/readbility
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+8
-17
src/winio.c
with
8 additions
and
17 deletions
+8
-17
src/winio.c
View file @
8edaa38a
...
...
@@ -1813,23 +1813,17 @@ void check_statusblank(void)
* "$" at the beginning or end of the line if it's too long. */
char
*
display_string
(
const
char
*
buf
,
size_t
column
,
size_t
span
,
bool
isdata
)
{
size_t
start_index
;
/*
Index in buf
of the first character show
n
. */
size_t
start_col
;
/*
Screen column that start_index corresponds to
. */
size_t
start_index
=
actual_x
(
buf
,
column
)
;
/*
The index
of the first character
that the caller wishes to
show. */
size_t
start_col
=
strnlenpt
(
buf
,
start_index
)
;
/*
The actual column where that first character starts
. */
char
*
converted
;
/* The expanded string we will return. */
size_t
index
;
size_t
index
=
0
;
/* Current position in converted. */
size_t
beyond
=
column
+
span
;
/* The column number just beyond the last shown character. */
start_index
=
actual_x
(
buf
,
column
);
start_col
=
strnlenpt
(
buf
,
start_index
);
assert
(
start_col
<=
column
);
index
=
0
;
#ifdef USING_OLD_NCURSES
seen_wide
=
FALSE
;
#endif
...
...
@@ -3371,12 +3365,9 @@ void do_credits(void)
const
char
*
what
;
size_t
start_col
;
if
(
credits
[
crpos
]
==
NULL
)
{
assert
(
0
<=
xlpos
&&
xlpos
<
XLCREDIT_LEN
);
what
=
_
(
xlcredits
[
xlpos
]);
xlpos
++
;
}
else
if
(
credits
[
crpos
]
==
NULL
)
what
=
_
(
xlcredits
[
xlpos
++
]);
else
what
=
credits
[
crpos
];
start_col
=
COLS
/
2
-
strlenpt
(
what
)
/
2
-
1
;
...
...
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