1 | diff --git a/src/Makefile.in b/src/Makefile.in |
1 | diff --git a/src/Makefile.in b/src/Makefile.in |
2 | index defe61d..cbbacd1 100644 |
2 | index d374ae83..08a26e65 100644 |
3 | --- a/src/Makefile.in |
3 | --- a/src/Makefile.in |
4 | +++ b/src/Makefile.in |
4 | +++ b/src/Makefile.in |
5 | @@ -35,7 +35,7 @@ COMMON = \ |
5 | @@ -40,7 +40,7 @@ COMMON = \ |
6 | screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \ |
6 | screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \ |
7 | scrollbar-xterm.o scrollbar-plain.o xdefaults.o encoding.o \ |
7 | scrollbar-xterm.o scrollbar-plain.o xdefaults.o encoding.o \ |
8 | rxvttoolkit.o rxvtutil.o keyboard.o rxvtimg.o \ |
8 | rxvttoolkit.o rxvtutil.o keyboard.o rxvtimg.o \ |
9 | - ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o @PERL_O@ |
9 | - ev_cpp.o @PERL_O@ |
10 | + ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o wcwidth.o @PERL_O@ |
10 | + ev_cpp.o @PERL_O@ wcwidth.o |
11 | |
11 | |
12 | COMMON_DAEMON = rxvtdaemon.o |
12 | COMMON_DAEMON = rxvtdaemon.o |
13 | |
13 | |
14 | diff --git a/src/rxvt.h b/src/rxvt.h |
14 | diff --git a/src/rxvt.h b/src/rxvt.h |
15 | index 5be4391..152bf64 100644 |
15 | index 043b7c18..5bcfdb01 100644 |
16 | --- a/src/rxvt.h |
16 | --- a/src/rxvt.h |
17 | +++ b/src/rxvt.h |
17 | +++ b/src/rxvt.h |
18 | @@ -706,6 +706,12 @@ typedef struct _mwmhints |
18 | @@ -652,6 +652,12 @@ typedef struct _mwmhints |
19 | // speed hack, copy some member variable into a local variable of the same name |
19 | // speed hack, copy some member variable into a local variable of the same name |
20 | #define dLocal(type,name) type const name = this->name |
20 | #define dLocal(type,name) type const name = this->name |
21 | |
21 | |
22 | +int mk_wcwidth(wchar_t c); |
22 | +int mk_wcwidth(wchar_t c); |
23 | +int mk_wcswidth(const wchar_t *s, size_t n); |
23 | +int mk_wcswidth(const wchar_t *s, size_t n); |
… | |
… | |
28 | // for speed reasons, we assume that all codepoints 32 to 126 are |
28 | // for speed reasons, we assume that all codepoints 32 to 126 are |
29 | // single-width. |
29 | // single-width. |
30 | #define WCWIDTH(c) (IN_RANGE_INC (c, 0x20, 0x7e) ? 1 : wcwidth (c)) |
30 | #define WCWIDTH(c) (IN_RANGE_INC (c, 0x20, 0x7e) ? 1 : wcwidth (c)) |
31 | diff --git a/src/wcwidth.C b/src/wcwidth.C |
31 | diff --git a/src/wcwidth.C b/src/wcwidth.C |
32 | new file mode 100644 |
32 | new file mode 100644 |
33 | index 0000000..c3d90a6 |
33 | index 00000000..c3d90a6a |
34 | --- /dev/null |
34 | --- /dev/null |
35 | +++ b/src/wcwidth.C |
35 | +++ b/src/wcwidth.C |
36 | @@ -0,0 +1,218 @@ |
36 | @@ -0,0 +1,218 @@ |
37 | +/* |
37 | +/* |
38 | + * This is an implementation of wcwidth() and wcswidth() (defined in |
38 | + * This is an implementation of wcwidth() and wcswidth() (defined in |