Fix editor rendering special characters to the terminal.

This commit is contained in:
Jonas 'Sortie' Termansen 2015-03-21 13:20:58 +01:00
parent 38f8384d78
commit be1585488d
1 changed files with 6 additions and 0 deletions

View File

@ -76,6 +76,12 @@ void update_terminal_entry(FILE* fp, struct terminal_datum entry, int x, int y,
size_t count = wcrtomb(mb, entry.character, &ps);
if ( count == (size_t) -1 )
fputs("<EFBFBD>", fp);
else if ( entry.character == L'\b' ||
entry.character == L'\e' ||
entry.character == L'\n' ||
entry.character == L'\r' ||
entry.character == L'\t' )
fputs("<EFBFBD>", fp);
else for ( size_t i = 0; i < count; i++ )
fputc(mb[i], fp);
current->data[index] = entry;