mirror of https://github.com/MidnightCommander/mc
* util.c (load_mc_home_file): Eliminate g_strdup_printf().
This commit is contained in:
parent
474fc58d94
commit
948cfd2606
|
@ -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>
|
2003-11-19 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* user.c (expand_format): Preserve "%" if followed by a
|
* user.c (expand_format): Preserve "%" if followed by a
|
||||||
|
|
10
src/util.c
10
src/util.c
|
@ -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 *hintfile_base, *hintfile;
|
||||||
char *lang;
|
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);
|
hintfile_base = concat_dir_and_file (mc_home, filename);
|
||||||
lang = guess_message_value ();
|
lang = guess_message_value ();
|
||||||
|
|
||||||
hintfile = g_strdup_printf ("%s.%s", hintfile_base, lang);
|
hintfile = g_strconcat (hintfile_base, ".", lang, NULL);
|
||||||
data = load_file (hintfile);
|
data = load_file (hintfile);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
g_free (hintfile);
|
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);
|
data = load_file (hintfile);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
|
Loading…
Reference in New Issue