* util.c (load_mc_home_file): Eliminate g_strdup_printf().

This commit is contained in:
Pavel Roskin 2003-11-20 18:38:29 +00:00
parent 474fc58d94
commit 948cfd2606
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2003-11-20 Andrew V. Samoilov <sav@bcs.zp.ua>
* util.c (load_mc_home_file): Eliminate g_strdup_printf().
2003-11-19 Pavel Roskin <proski@gnu.org>
* user.c (expand_format): Preserve "%" if followed by a

View File

@ -619,7 +619,8 @@ char *load_file (char *filename)
}
}
char *load_mc_home_file (const char *filename, char ** allocated_filename)
char *
load_mc_home_file (const char *filename, char **allocated_filename)
{
char *hintfile_base, *hintfile;
char *lang;
@ -628,12 +629,15 @@ char *load_mc_home_file (const char *filename, char ** allocated_filename)
hintfile_base = concat_dir_and_file (mc_home, filename);
lang = guess_message_value ();
hintfile = g_strdup_printf ("%s.%s", hintfile_base, lang);
hintfile = g_strconcat (hintfile_base, ".", lang, NULL);
data = load_file (hintfile);
if (!data) {
g_free (hintfile);
hintfile = g_strdup_printf ("%s.%.2s", hintfile_base, lang);
/* Fall back to the two-letter language code */
if (lang[0] && lang[1])
lang[2] = 0;
hintfile = g_strconcat (hintfile_base, ".", lang, NULL);
data = load_file (hintfile);
if (!data) {