From 7733f432a44e1ce3a817f6cc05073294e7543d68 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Mon, 7 Feb 2005 00:01:15 +0000 Subject: [PATCH] * ext.c: Improved message formatting. --- src/ChangeLog | 4 ++++ src/ext.c | 56 ++++++++++++++++++++++----------------------------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9dd158f80..b105db90b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-02-07 Roland Illig + + * ext.c: Improved message formatting. + 2005-02-06 Roland Illig * widget.h: Added a new function button_get_text. diff --git a/src/ext.c b/src/ext.c index 8e5390290..f675434f9 100644 --- a/src/ext.c +++ b/src/ext.c @@ -461,43 +461,35 @@ regex_command (const char *filename, const char *action, int *move_dir) home_error = 1; goto check_stock_mc_ext; } else { - char *msg; - char *msg2; - msg = - g_strconcat (" ", mc_home, MC_LIB_EXT, - _(" file error "), (char *) NULL); - msg2 = - g_strconcat (_("Format of the "), mc_home, - _("mc.ext file has changed\n" - "with version 3.0. It seems that installation\n" - "failed. Please fetch a fresh new copy from the\n" - "Midnight Commander package."), - (char *) NULL); - message (1, msg, "%s", msg2); - g_free (msg); - g_free (msg2); + GString *msg1 = g_string_new (NULL); + GString *msg2 = g_string_new (NULL); + + g_string_sprintf (msg1, _(" %s%s file error"), + mc_home, MC_LIB_EXT); + g_string_sprintf (msg2, _("The format of the %smc.ext " + "file has changed with version 3.0. It seems that " + "the installation failed. Please fetch a fresh " + "copy from the Midnight Commander package."), + mc_home); + message (1, msg1->str, "%s", msg2->str); + g_string_free (msg1, TRUE); + g_string_free (msg2, TRUE); return 0; } } } if (home_error) { - char *msg; - char *msg2; - msg = - g_strconcat (" ~/", MC_USER_EXT, _(" file error "), (char *) NULL); - msg2 = - g_strconcat (_("Format of the "), "~/", MC_USER_EXT, - _(" file has changed\n" - "with version 3.0. You may want either to\n" - "copy it from "), mc_home, - _("mc.ext or use that\n" - "file as an example of how to write it.\n"), - mc_home, - _("mc.ext will be used for this moment."), - (char *) NULL); - message (1, msg, "%s", msg2); - g_free (msg); - g_free (msg2); + GString *title = g_string_new (NULL); + GString *text = g_string_new (NULL); + + g_string_sprintf (title, _(" ~/%s file error "), MC_USER_EXT); + g_string_sprintf (text, _("The format of the ~/%s file has " + "changed with version 3.0. You may either want to copy " + "it from %smc.ext of use that file as an example of how " + "to write it."), MC_USER_EXT, mc_home, mc_home); + message (1, title->str, "%s", text->str); + g_string_free (title, TRUE); + g_string_free (text, TRUE); } } mc_stat (filename, &mystat);