From 28fed14a038af7b1a336eb574eb937432c0d2f63 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Tue, 8 Feb 2005 07:31:11 +0000 Subject: [PATCH] * ext.c (regex_command): Eliminate g_string_*(). --- src/ChangeLog | 4 ++++ src/ext.c | 28 ++++++++++------------------ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 638dd6040..eb8b62a78 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-02-08 Andrew V. Samoilov + + * ext.c (regex_command): Eliminate g_string_*(). + 2005-02-08 Roland Illig * dialog.h: Moved and reformatted #definitions. diff --git a/src/ext.c b/src/ext.c index f675434f9..90bcf4bce 100644 --- a/src/ext.c +++ b/src/ext.c @@ -461,35 +461,27 @@ regex_command (const char *filename, const char *action, int *move_dir) home_error = 1; goto check_stock_mc_ext; } else { - 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 " + char *title = + g_strdup_printf (_(" %s%s file error"), + mc_home, MC_LIB_EXT); + message (1, title, _("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); + g_free (title); return 0; } } } if (home_error) { - 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 " + char *title = + g_strdup_printf (_(" ~/%s file error "), MC_USER_EXT); + message (1, title, _("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); + "to write it."), MC_USER_EXT, mc_home); + g_free (title); } } mc_stat (filename, &mystat);