From 830eccebc359c9cf4f1596651eb7bd7a71ed0952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= Date: Wed, 1 Dec 2010 01:30:20 +0000 Subject: [PATCH] NOHYPHEN fix --- ChangeLog | 4 ++++ NEWS | 2 ++ configure.in | 4 ++-- hyphen.c | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 519d851..60534ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-12-01 László Németh : + * hyphen.c: NOHYPHEN fix for a special case (NOHYPHEN + character in starting position, eg. "-example") + 2010-11-27 László Németh : * hyphen.c: add NOHYPHEN feature to handle special hyphenation at hyphens and apostrophes, diff --git a/NEWS b/NEWS index c1a6f10..81ccd1e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +2010-12-01 Hyphen 2,7,1 bug fix release + 2010-11-27 Hyphen 2.7 release: - The new hyphenation problem of OpenOffice.org 3.2, related to its modified word breaking of words with hyphen characters, can be fixed diff --git a/configure.in b/configure.in index e66d4c2..69c2acf 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ -AC_INIT([hyphen],[2.7],[nemeth@openoffice.org]) -AM_INIT_AUTOMAKE(hyphen,2.7) +AC_INIT([hyphen],[2.7.1],[nemeth@openoffice.org]) +AM_INIT_AUTOMAKE(hyphen,2.7.1) AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL diff --git a/hyphen.c b/hyphen.c index 700a8e1..93685b1 100644 --- a/hyphen.c +++ b/hyphen.c @@ -1078,7 +1078,7 @@ int hnj_hyphen_hyphenate2 (HyphenDict *dict, char * nhy = (char *) strstr(word, nh); while (nhy) { hyphens[nhy - word + strlen(nh) - 1] = 0; - hyphens[nhy - word - 1] = 0; + if (nhy - word - 1 >= 0) hyphens[nhy - word - 1] = 0; nhy = (char *) strstr(nhy + 1, nh); } nh = nh + strlen(nh) + 1; @@ -1114,7 +1114,7 @@ int hnj_hyphen_hyphenate3 (HyphenDict *dict, char * nhy = (char *) strstr(word, nh); while (nhy) { hyphens[nhy - word + strlen(nh) - 1] = 0; - hyphens[nhy - word - 1] = 0; + if (nhy - word - 1 >= 0) hyphens[nhy - word - 1] = 0; nhy = (char *) strstr(nhy + 1, nh); } nh = nh + strlen(nh) + 1;