mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Minor optimization of help file conversion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
8cb8c7efa9
commit
49f3028764
10
src/help.c
10
src/help.c
@ -835,7 +835,8 @@ translate_file (char *filedata)
|
||||
GIConv conv;
|
||||
GString *translated_data;
|
||||
|
||||
translated_data = g_string_new ("");
|
||||
/* initial allocation for largest whole help file */
|
||||
translated_data = g_string_sized_new (32 * 1024);
|
||||
|
||||
conv = str_crt_conv_from ("UTF-8");
|
||||
|
||||
@ -844,10 +845,9 @@ translate_file (char *filedata)
|
||||
else {
|
||||
g_free (fdata);
|
||||
|
||||
if (str_convert (conv, filedata, translated_data) != ESTR_FAILURE) {
|
||||
fdata = translated_data->str;
|
||||
g_string_free (translated_data, FALSE);
|
||||
} else {
|
||||
if (str_convert (conv, filedata, translated_data) != ESTR_FAILURE)
|
||||
fdata = g_string_free (translated_data, FALSE);
|
||||
else {
|
||||
fdata = NULL;
|
||||
g_string_free (translated_data, TRUE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user