git: 2f4db26fc878 - 2023Q2 - devel/appstream-compose: Fix crash when processing Qt translation files.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 15 Apr 2023 19:30:30 UTC
The branch 2023Q2 has been updated by arrowd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=2f4db26fc878c05fb042b440254c6cbf4d2b0975
commit 2f4db26fc878c05fb042b440254c6cbf4d2b0975
Author: Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2023-04-13 12:57:06 +0000
Commit: Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2023-04-15 19:30:17 +0000
devel/appstream-compose: Fix crash when processing Qt translation files.
Upstream PR: https://github.com/ximion/appstream/pull/484
Sponsored by: Serenity Cybersecurity, LLC
(cherry picked from commit b472fd9630da4677706c36722c4fd4517ff45701)
---
devel/appstream-compose/Makefile | 2 +-
devel/appstream/files/patch-compose_asc-utils-l10n.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/devel/appstream-compose/Makefile b/devel/appstream-compose/Makefile
index 06b780de3734..07d24c7568f4 100644
--- a/devel/appstream-compose/Makefile
+++ b/devel/appstream-compose/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION= 0
+PORTREVISION= 1
PKGNAMESUFFIX= Compose
COMMENT?= AppStream Compose application and library
diff --git a/devel/appstream/files/patch-compose_asc-utils-l10n.c b/devel/appstream/files/patch-compose_asc-utils-l10n.c
new file mode 100644
index 000000000000..289b96b827f4
--- /dev/null
+++ b/devel/appstream/files/patch-compose_asc-utils-l10n.c
@@ -0,0 +1,15 @@
+--- compose/asc-utils-l10n.c.orig 2023-02-10 19:54:13 UTC
++++ compose/asc-utils-l10n.c
+@@ -390,11 +390,7 @@ asc_l10n_search_translations_qt (AscLocaleContext *ctx
+ locale = g_strdup (fname + strlen (qm_root) + 1);
+ g_strdelimit (locale, ".", '\0');
+ tmp = g_strstr_len (locale, -1, "/");
+- if (tmp != NULL) {
+- /* we have the ${hint}/${locale}.qm form */
+- locale = tmp + 1;
+- }
+- if (!asc_l10n_parse_file_qt (ctx, unit, locale, fname, error))
++ if (!asc_l10n_parse_file_qt (ctx, unit, tmp == NULL ? locale : tmp + 1, fname, error))
+ return FALSE;
+ }
+ }