diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2014-04-25 14:24:51 +0200 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2014-04-25 14:24:51 +0200 |
commit | e9e78d9b2b413337d9f783ad9a514c8accd25ac9 (patch) | |
tree | 80f0773c1fc14ab95c1ce3c713fe07621e4d84fd /src/tty.sh | |
parent | fe0669d90d587a00f863e0a8f38c9f462a833554 (diff) | |
download | screen-e9e78d9b2b413337d9f783ad9a514c8accd25ac9.tar.gz |
fix-utf8-status-padding-bug
Ensure that multibyte UTF8 characters are counted correctly when
calculating and displaying the caption and hardstatus lines.
Based on an earlier version by Kees Cook <address@hidden>
Signed-off-by: Dustin Kirkland <address@hidden>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Diffstat (limited to 'src/tty.sh')
-rw-r--r-- | src/tty.sh | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -60,6 +60,7 @@ exit 0 #include <sys/types.h> #include <signal.h> #include <fcntl.h> +#include <sys/stat.h> #ifndef sgi # include <sys/file.h> #endif @@ -1499,6 +1500,19 @@ int ibaud, obaud; return 0; } + +int +CheckTtyname (tty) +char *tty; +{ + struct stat st; + + if (lstat(tty, &st) || !S_ISCHR(st.st_mode) || + (st.st_nlink > 1 && strncmp(tty, "/dev/", 5))) + return -1; + return 0; +} + /* * Write out the mode struct in a readable form */ |