]> git.pld-linux.org Git - packages/xchat-gnome.git/blame - xchat-gnome-long-delimiter.patch
- converted to UTF-8
[packages/xchat-gnome.git] / xchat-gnome-long-delimiter.patch
CommitLineData
53a7e024 1diff -ur xchat-gnome-0.14-o/src/fe-gnome/xtext.c xchat-gnome-0.14/src/fe-gnome/xtext.c
2--- xchat-gnome-0.14-o/src/fe-gnome/xtext.c 2006-10-15 17:19:09.000000000 -0600
3+++ xchat-gnome-0.14/src/fe-gnome/xtext.c 2006-10-28 21:55:54.000000000 -0600
4@@ -64,9 +64,16 @@
5 #include "xg-marshal.h"
c0630684 6
7 /* is delimiter */
8-#define is_del(c) \
9- (c == ' ' || c == '\n' || c == ')' || c == '(' || \
10- c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0)
11+int is_del(const char *c) {
12+ int ret;
13+ ret = 0;
14+ ret = (c[0] == ' ' || c[0] == '\n' || c[0] == ')' || c[0] == '(' ||
15+ c[0] == '>' || c[0] == '<' || c[0] == ATTR_RESET || c[0] == ATTR_BOLD || c == 0);
16+ if(!ret) {
17+ ret = strncmp(c, "“", 3) == 0 || strncmp(c, "”", 3) == 0;
18+ }
19+ return ret;
20+}
21
c0630684 22 /* force scrolling off */
53a7e024 23 #define dontscroll(buf) (buf)->last_pixel_pos = 0x7fffffff
24@@ -1576,6 +1583,7 @@
c0630684 25 int offset;
26 unsigned char *str;
27 unsigned char *word;
28+ unsigned char *nstr;
29 int len;
30 int out_of_bounds = 0;
31
53a7e024 32@@ -1586,16 +1594,16 @@
c0630684 33
34 str = ent->str + offset;
35
53a7e024 36- while (!is_del (*str) && str != ent->str) {
c0630684 37- str--;
53a7e024 38- }
c0630684 39- word = str + 1;
53a7e024 40+ while (!is_del(str))
41+ str = g_utf8_prev_char(str);
42+ word = g_utf8_next_char(str);
c0630684 43
44 len = 0;
45 str = word;
53a7e024 46- while (!is_del (*str) && len != ent->str_len) {
c0630684 47- str++;
48- len++;
53a7e024 49+ while (!is_del(str) && len != ent->str_len) {
50+ nstr = g_utf8_next_char(str);
51+ len += nstr - str;
52+ str = nstr;
c0630684 53 }
54
53a7e024 55 if (len > 0 && word[len-1]=='.') {
56@@ -3452,7 +3460,7 @@
c0630684 57 }
58
59 /* keep a record of the last space, for wordwrapping */
53a7e024 60- if (is_del (*str)) {
61+ if (g_unichar_isspace(g_utf8_get_char(str))) {
c0630684 62 last_space = str;
63 limit_offset = 0;
53a7e024 64 }
65Only in xchat-gnome-0.14/src/fe-gnome: xtext.c~
66Only in xchat-gnome-0.14/src/fe-gnome: xtext.c.orig
67Only in xchat-gnome-0.14/src/fe-gnome: xtext.c.rej
This page took 0.02855 seconds and 4 git commands to generate.