external/libnumbertext/EmptyString.patch1               |   13 +++++++++++++
 external/libnumbertext/UnpackedTarball_libnumbertext.mk |    1 +
 2 files changed, 14 insertions(+)

New commits:
commit 35ca93f7892e8f19b871f7f687a9f7e4933a65ad
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jun 27 09:40:22 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Jun 27 13:19:25 2022 +0200

    crashtesting: fix assert seen on loading forum-nl-1226.ods
    
    Change-Id: If8c08a51b11a459a03b4a0604c1fb9897351e598
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136480
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/external/libnumbertext/EmptyString.patch1 
b/external/libnumbertext/EmptyString.patch1
new file mode 100644
index 000000000000..d6570117da09
--- /dev/null
+++ b/external/libnumbertext/EmptyString.patch1
@@ -0,0 +1,13 @@
+--- a/src/Soros.cxx    2022-06-27 09:36:46.486075920 +0100
++++ b/src/Soros.cxx    2022-06-27 09:37:52.594072196 +0100
+@@ -98,8 +98,8 @@
+             s = regex_replace(s, quoteEnd, L"");
+             s = translate(s, c.substr(1), m.substr(1), L"");
+             replace(s, slash, L"\\\\"); // -> \\, ", ;, #
+-            begins.push_back(s[0] == L'^');
+-            ends.push_back(s[s.length()-1] == L'$');
++            begins.push_back(!s.empty() && s[0] == L'^');
++            ends.push_back(!s.empty() && s[s.length()-1] == L'$');
+             s = L"^" + regex_replace(s, wregex(L"^\\^"), L"");
+             s = regex_replace(s, wregex(L"\\$$"), L"") + L"$";
+             try
diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk 
b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
index 48cd2a9a273d..fb88366d5aef 100644
--- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk
+++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
@@ -18,6 +18,7 @@ $(eval $(call 
gb_UnpackedTarball_set_patchlevel,libnumbertext,1))
 $(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \
     external/libnumbertext/MSVCNonBMPBug.patch1 \
     external/libnumbertext/WinUnicodePath.patch1 \
+    external/libnumbertext/EmptyString.patch1 \
 ))
 
 # vim: set noet sw=4 ts=4:

Reply via email to