1 diff -u procps-3.2.7/Makefile procps/Makefile
2 --- procps-3.2.7/Makefile 2007-01-16 17:24:49.000000000 +0100
3 +++ procps/Makefile 2007-01-16 17:29:27.000000000 +0100
5 # plus the top-level Makefile to make it work stand-alone.
11 # This seems about right for the dynamic library stuff.
12 # Something like this is probably needed to make the SE Linux
13 diff -u procps-3.2.7/watch.c procps/watch.c
14 --- procps-3.2.7/watch.c 2007-01-16 17:24:49.000000000 +0100
15 +++ procps/watch.c 2007-01-16 18:06:57.000000000 +0100
19 #include "proc/procps.h"
30 +readwc(FILE *stream, mbstate_t *mbs)
42 + len = mbrtowc(&wc, &c, 1, mbs);
43 + if (len == (size_t)-1)
44 + memset(mbs, 0, sizeof(*mbs));
45 + else if (len != (size_t)-2)
51 main(int argc, char *argv[])
59 if (screen_size_changed) {
65 + memset(&mbs, 0, sizeof(mbs));
66 for (y = show_title; y < height; y++) {
67 int eolseen = 0, tabpending = 0;
68 for (x = 0; x < width; x++) {
72 + int attr = 0, c_width;
77 /* if there is a tab pending, just spit spaces until the
78 next stop instead of reading characters */
82 - while (c != EOF && !isprint(c)
86 + c = readwc(p, &mbs);
87 + while (c != WEOF && !iswprint(c)
91 if (!oldeolseen && x == 0) {
97 + else if (c == L'\t')
99 - if (c == EOF || c == '\n' || c == '\t')
101 + if (c == WEOF || c == L'\n' || c == L'\t')
103 if (tabpending && (((x + 1) % 8) == 0))
108 + setcchar (&cc, wstr, 0, 0, NULL);
110 if (option_differences) {
111 - chtype oldch = inch();
112 - char oldc = oldch & A_CHARTEXT;
114 + wchar_t oldwstr[2];
119 + getcchar(&oldc, oldwstr, &attrs, &colors, NULL);
121 - && ((char)c != oldc
122 + && (wstr[0] != oldwstr[0]
124 (option_differences_cumulative
125 - && (oldch & A_ATTRIBUTES)));
134 + c_width = wcwidth(c);
138 oldeolseen = eolseen;