* screen.c (string_file_name): Replace non-printable characters

with question marks.
This commit is contained in:
Pavel Roskin 2002-08-15 16:52:51 +00:00
parent f0dbdeb72e
commit 58da40fa6a
2 changed files with 22 additions and 1 deletions

View File

@ -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

View File

@ -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 */