mirror of
https://github.com/MidnightCommander/mc
synced 2025-04-02 05:02:58 +03:00
* screen.c (string_file_name): Replace non-printable characters
with question marks.
This commit is contained in:
parent
f0dbdeb72e
commit
58da40fa6a
@ -1,5 +1,8 @@
|
||||
2002-08-15 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* screen.c (string_file_name): Replace non-printable characters
|
||||
with question marks.
|
||||
|
||||
* subshell.c (read_subshell_prompt): Remove argument "how", it's
|
||||
never set to VISIBLY. Adjust all dependencies. Eliminate hack
|
||||
with "clear_now" - it causes invalid memory access and hides the
|
||||
|
20
src/screen.c
20
src/screen.c
@ -146,7 +146,25 @@ add_permission_string (char *dest, int width, file_entry *fe, int attr, int colo
|
||||
static char *
|
||||
string_file_name (file_entry *fe, int len)
|
||||
{
|
||||
return fe->fname;
|
||||
static char buffer [BUF_SMALL];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(buffer); i++) {
|
||||
char c;
|
||||
|
||||
c = fe->fname[i];
|
||||
|
||||
if (!c)
|
||||
break;
|
||||
|
||||
if (!is_printable(c))
|
||||
c = '?';
|
||||
|
||||
buffer[i] = c;
|
||||
}
|
||||
|
||||
buffer[i] = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/* size */
|
||||
|
Loading…
x
Reference in New Issue
Block a user