]> granicus.if.org Git - procps-ng/commitdiff
watch: fix to backporting error, and other wide character issues
authorSami Kerola <kerolasa@iki.fi>
Tue, 29 May 2012 19:39:57 +0000 (21:39 +0200)
committerCraig Small <csmall@enc.com.au>
Wed, 30 May 2012 12:03:31 +0000 (22:03 +1000)
The commit 8967f0fca3ab53479071a01f1522a19517ecb9cd has an typo like
error, which I must have done.  The Bug-Debian 240989 did not have 12
but 128.  Rest of the fixes are from Bug-Debian 675069 e.g. missing
include added, and usage of iswprint().

Bug-Debian: http://bugs.debian.org/240989
Bug-Debian: http://bugs.debian.org/675069
Reported-by: "Dr. David Alan Gilbert" <dave@treblig.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
watch.c

diff --git a/watch.c b/watch.c
index 4649844723ab9b26fdd9b292d46c25df43fefed7..e454308279b100a34d18f2f6d46068a87dc4758d 100644 (file)
--- a/watch.c
+++ b/watch.c
@@ -53,6 +53,7 @@
 #include <unistd.h>
 #ifdef WITH_WATCH8BIT
 # include <wchar.h>
+# include <wctype.h>
 # include <ncursesw/ncurses.h>
 #else
 # include <ncurses.h>
@@ -438,8 +439,8 @@ int run_command(char *restrict command, char **restrict command_argv)
                                                        c = carry;
                                                        carry = WEOF;
                                                }
-                                       } while (c != WEOF && !isprint(c)
-                                                && c < 12
+                                       } while (c != WEOF && !iswprint(c)
+                                                && c < 128
                                                 && wcwidth(c) == 0
                                                 && c != L'\n'
                                                 && c != L'\t'