commit deb7bc34ad28c07744e5c691f4b24727278b3925
parent 4f125f1829e19a0172b1a31b6e0b702d71406058
Author: wwp <subscript@free.fr>
Date: Tue, 12 Apr 2022 14:09:12 +0200
Fixing compilation issue due to the use of GLIB 2.50's G_PID_FORMAT in translated strings (also depends on the GLIBC/gettext version).
Diffstat:
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/compose.c b/src/compose.c
@@ -9813,19 +9813,27 @@ static gboolean compose_get_ext_editor_cmd_valid()
static gboolean compose_ext_editor_kill(Compose *compose)
{
GPid pid = compose->exteditor_pid;
+ gchar *pidmsg = NULL;
if (pid > 0) {
AlertValue val;
gchar *msg;
+ pidmsg = g_strdup_printf
+#if GLIB_CHECK_VERSION(2, 50, 0)
+ (_("process id: %" G_PID_FORMAT),
+#else
+ (_("process id: %d"),
+#endif
+ pid);
+
msg = g_strdup_printf
(_("The external editor is still working.\n"
"Force terminating the process?\n"
- "process id: %" G_PID_FORMAT), pid);
+ "%s"), pidmsg);
val = alertpanel_full(_("Notice"), msg, NULL, _("_No"), NULL, _("_Yes"),
NULL, NULL, ALERTFOCUS_FIRST, FALSE, NULL,
ALERT_WARNING);
-
g_free(msg);
if (val == G_ALERTALTERNATE) {
@@ -9839,8 +9847,8 @@ static gboolean compose_ext_editor_kill(Compose *compose)
waitpid(compose->exteditor_pid, NULL, 0);
#endif /* G_OS_WIN32 */
- g_warning("terminated process id: %" G_PID_FORMAT ", "
- "temporary file: %s", pid, compose->exteditor_file);
+ g_warning("terminated %s, temporary file: %s",
+ pidmsg, compose->exteditor_file);
g_spawn_close_pid(compose->exteditor_pid);
compose_set_ext_editor_sensitive(compose, TRUE);
@@ -9849,10 +9857,14 @@ static gboolean compose_ext_editor_kill(Compose *compose)
compose->exteditor_file = NULL;
compose->exteditor_pid = INVALID_PID;
compose->exteditor_tag = -1;
- } else
+ } else {
+ g_free(pidmsg);
return FALSE;
+ }
}
+ if (pidmsg)
+ g_free(pidmsg);
return TRUE;
}