aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-04-11 22:01:15 +0200
committerThomas White <taw@bitwiz.org.uk>2013-04-11 22:01:15 +0200
commit4cf06c3eede04e0c3c4f33f0be932e8b9fe5f01f (patch)
tree784e48aec8ad5b78fab04667af786ec65d1d5f7e /src
parent604887ea5163ee2fd3c838bb06d8a1783976b9e1 (diff)
Handle newline at end of text
Diffstat (limited to 'src')
-rw-r--r--src/wrap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/wrap.c b/src/wrap.c
index ff801fa..98a1fd7 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -301,8 +301,22 @@ static int split_words(struct wrap_line *boxes, PangoContext *pc, char *sc,
return 1;
}
- add_wrap_box(boxes, word, start, WRAP_SPACE_NONE, pc,
- font, fontdesc, col);
+ if ( (word[i-start-1] == '\n') ) {
+
+ /* There is a newline at the end of the SC */
+ char *word2;
+ word2 = strndup(word, i-start-1);
+ add_wrap_box(boxes, word2, start, WRAP_SPACE_EOP, pc,
+ font, fontdesc, col);
+ add_wrap_box(boxes, strdup(""), i, WRAP_SPACE_NONE, pc,
+ font, fontdesc, col);
+
+ } else {
+
+ add_wrap_box(boxes, word, start, WRAP_SPACE_NONE, pc,
+ font, fontdesc, col);
+
+ }
}