Skip to content
GitLab
Menu
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
a37cd9f0
Commit
a37cd9f0
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a variable, to clarify it refers to columns, not to bytes
parent
6f12992c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/proto.h
+2
-2
src/proto.h
src/winio.c
+9
-9
src/winio.c
with
11 additions
and
11 deletions
+11
-11
src/proto.h
View file @
a37cd9f0
...
...
@@ -787,8 +787,8 @@ void blank_edit(void);
void
blank_statusbar
(
void
);
void
blank_bottombars
(
void
);
void
check_statusblank
(
void
);
char
*
display_string
(
const
char
*
buf
,
size_t
start_col
,
size_t
len
,
bool
dollars
);
char
*
display_string
(
const
char
*
buf
,
size_t
start_col
,
size_t
span
,
bool
dollars
);
void
titlebar
(
const
char
*
path
);
extern
void
set_modified
(
void
);
void
statusbar
(
const
char
*
msg
);
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
a37cd9f0
...
...
@@ -1719,13 +1719,13 @@ void check_statusblank(void)
/* Convert buf into a string that can be displayed on screen. The
* caller wants to display buf starting with column start_col, and
* extending for at most
le
n columns. start_col is zero-based.
len is
* one-based, so
le
n == 0 means you get "" returned. The returned
* extending for at most
spa
n columns. start_col is zero-based.
span
*
is
one-based, so
spa
n == 0 means you get "" returned. The returned
* string is dynamically allocated, and should be freed. If dollars is
* TRUE, the caller might put "$" at the beginning or end of the line if
* it's too long. */
char
*
display_string
(
const
char
*
buf
,
size_t
start_col
,
size_t
len
,
bool
dollars
)
char
*
display_string
(
const
char
*
buf
,
size_t
start_col
,
size_t
span
,
bool
dollars
)
{
size_t
start_index
;
/* Index in buf of the first character shown. */
...
...
@@ -1738,10 +1738,10 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
/* If dollars is TRUE, make room for the "$" at the end of the
* line. */
if
(
dollars
&&
le
n
>
0
&&
strlenpt
(
buf
)
>
start_col
+
le
n
)
le
n
--
;
if
(
dollars
&&
spa
n
>
0
&&
strlenpt
(
buf
)
>
start_col
+
spa
n
)
spa
n
--
;
if
(
le
n
==
0
)
if
(
spa
n
==
0
)
return
mallocstrcpy
(
NULL
,
""
);
start_index
=
actual_x
(
buf
,
start_col
);
...
...
@@ -1859,8 +1859,8 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
/* Null-terminate converted. */
converted
[
index
]
=
'\0'
;
/* Make sure converted takes up no more than
le
n columns. */
index
=
actual_x
(
converted
,
le
n
);
/* Make sure converted takes up no more than
spa
n columns. */
index
=
actual_x
(
converted
,
spa
n
);
null_at
(
&
converted
,
index
);
return
converted
;
...
...
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