Skip to content

Commit

Permalink
Merge pull request #213 from rrthomas/master
Browse files Browse the repository at this point in the history
Minor fix, and hence new minor release
  • Loading branch information
rrthomas authored Jun 17, 2019
2 parents 160baa1 + b70448e commit f119d58
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ matrix:

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install glib dbus-glib aspell hspell hunspell libvoikko unittest-cpp ; fi
# Note: aspell should work on macOS, but has been removed from the next
# line because one of the tests fails; see
# https://github.com/Homebrew/homebrew-core/issues/40976
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install glib dbus-glib hspell hunspell libvoikko unittest-cpp ; fi

script:
- ./bootstrap
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([enchant],[2.2.3])
AC_INIT([enchant],[2.2.4])
AC_CONFIG_SRCDIR(src/enchant.h)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([subdir-objects])
Expand Down Expand Up @@ -77,6 +77,7 @@ if test "$gl_gcc_warnings" = yes; then
nw="$nw -Wstrict-overflow" # Use a lower level (see below).
nw="$nw -Wconversion" # These warnings usually don’t point to mistakes.
nw="$nw -Wsign-conversion" # Likewise.
nw="$nw -Wimplicit-fallthrough=5" # We want to allow "fallthrough" comments.

gl_MANYWARN_ALL_GCC([warnings])

Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h1>Enchant</h1>

<h2>News</h2>

<p>June 17, 2018: Enchant 2.2.4 released.
<p>February 4, 2018: Enchant 2.2.3 released.
<p>January 3, 2018: Enchant 2.2.1 released.
<p>December 12, 2017: Enchant 2.2.0 released.
Expand Down
20 changes: 9 additions & 11 deletions src/enchant.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,13 @@ static GSList *
tokenize_line (EnchantDict * dict, GString * line)
{
GSList * tokens = NULL;
char *utf = (char *) line->str;

GString * word;

gunichar uc;
gchar *utf = (char *) line->str;
size_t cur_pos = 0;
size_t start_pos = 0;
word = g_string_new (NULL);
GString * word = g_string_new (NULL);

while (cur_pos < line->len && *utf) {
int i;
gunichar uc;

/* Skip non-word characters. */
cur_pos = g_utf8_pointer_to_offset ((const char*)line->str, utf);
Expand All @@ -228,10 +224,12 @@ tokenize_line (EnchantDict * dict, GString * line)
}

/* Skip backwards over any characters that can't appear at the end of a word. */
i = word->len-1;
while ((i >= 0) && !enchant_dict_is_word_character(dict, word->str[i], 2)) {
g_string_truncate (word, i);
i--;
for (gchar *i_utf = word->str + word->len;
(i_utf = g_utf8_find_prev_char (word->str, i_utf)) != NULL;
g_string_truncate (word, i_utf - word->str)) {
uc = g_utf8_get_char (i_utf);
if (enchant_dict_is_word_character(dict, uc, 2))
break;
}

/* Save (word, position) tuple. */
Expand Down

0 comments on commit f119d58

Please sign in to comment.