summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-01-16 12:28:11 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-01-16 12:28:11 +0000
commit5bda4edb1a0d42c4ab3072d3c83526dadd6c0124 (patch)
treece8af937d02e92610b91c2de094c800935333eae
parentd899ebb5fa8c2692ddd1de9c91dce7863e0089f1 (diff)
downloadnetsurf-5bda4edb1a0d42c4ab3072d3c83526dadd6c0124.tar.gz
netsurf-5bda4edb1a0d42c4ab3072d3c83526dadd6c0124.tar.bz2
Don't search back for spaces if the whole string fits in available width.
-rw-r--r--riscos/font.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/riscos/font.c b/riscos/font.c
index 717b9606c..d92d5b521 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -358,8 +358,9 @@ bool nsfont_split(const plot_font_style_t *fstyle,
return false;
}
- while (*char_offset && string[*char_offset] != ' ')
- (*char_offset)--;
+ if (*char_offset != length)
+ while (*char_offset && string[*char_offset] != ' ')
+ (*char_offset)--;
code = rufl_width(font_family, font_style, font_size,
string, *char_offset,