aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-08-18 23:01:15 +0200
committerThomas White <taw@bitwiz.org.uk>2015-08-18 23:12:51 +0200
commitc84b0e8f3aaceb57182f40e0979e12b38c8fc046 (patch)
treea233a114dbaf5a7ff547c8a4ef495dddf2d521fd
parent28fe5ce820b37428901cd504b5ff057c992365d9 (diff)
"Fix" UTF8 handling in split_words()
-rw-r--r--src/shape.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shape.c b/src/shape.c
index 74112b0..e5c568c 100644
--- a/src/shape.c
+++ b/src/shape.c
@@ -310,9 +310,10 @@ int split_words(struct wrap_line *boxes, PangoContext *pc, SCBlock *bl,
/* Stuff up to (but not including) sc[i] forms a
* wrap box */
len = offs - start;
+ /* FIXME: Ugh */
if ( log_attrs[i].is_mandatory_break ) {
type = WRAP_SPACE_EOP;
- if ( (i>0) && (text[i-1]=='\n') ) len--;
+ if ( (i>0) && (g_utf8_prev_char(ptr)[0]=='\n') ) len--;
} else if ( (i>0)
&& log_attrs[i-1].is_expandable_space ) {
type = WRAP_SPACE_INTERWORD;