hunspell: MSVC debug runtime iterators don't want to decrement past begin()

Change-Id: I258dc551d14ba72113b284be3566ba924434ab4c
This commit is contained in:
Michael Stahl
2016-04-15 23:38:56 +02:00
parent e2e35d56ab
commit e63f6503fc
2 changed files with 23 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-solaris.patch \
external/hunspell/hunspell-iterator.patch.1 \
))
ifeq ($(COM),MSC)

View File

@@ -0,0 +1,22 @@
MSVC debug runtime iterators don't want to be decremented past begin()
--- hunspell/src/hunspell/affixmgr.cxx.orig 2016-04-15 23:30:37.555875079 +0200
+++ hunspell/src/hunspell/affixmgr.cxx 2016-04-15 23:30:43.669875027 +0200
@@ -4638,7 +4638,7 @@
return;
int neg = 0;
- for (std::string::iterator k = piece.begin() + piece.size() - 1; k >= piece.begin(); --k) {
+ for (std::string::iterator k = piece.begin() + piece.size() - 1; ; --k) {
switch (*k) {
case '[': {
if (neg)
@@ -4666,6 +4666,8 @@
*(k + 1) = *k;
}
}
+ if (k == piece.begin())
+ break;
}
}