Commit d67a9d92 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wrc: Reset the language before processing multiple rc files.

parent 3115f335
...@@ -132,6 +132,7 @@ int extensions = 1; ...@@ -132,6 +132,7 @@ int extensions = 1;
/* /*
* Language setting for resources (-l option) * Language setting for resources (-l option)
*/ */
static language_t *defaultlanguage;
language_t *currentlanguage = NULL; language_t *currentlanguage = NULL;
/* /*
...@@ -289,6 +290,9 @@ static int load_file( const char *input_name, const char *output_name ) ...@@ -289,6 +290,9 @@ static int load_file( const char *input_name, const char *output_name )
input_name = temp_name; input_name = temp_name;
} }
/* Reset the language */
currentlanguage = dup_language( defaultlanguage );
/* Go from .rc to .res */ /* Go from .rc to .res */
chat("Starting parse\n"); chat("Starting parse\n");
...@@ -302,6 +306,7 @@ static int load_file( const char *input_name, const char *output_name ) ...@@ -302,6 +306,7 @@ static int load_file( const char *input_name, const char *output_name )
unlink( temp_name ); unlink( temp_name );
temp_name = NULL; temp_name = NULL;
} }
free( currentlanguage );
return ret; return ret;
} }
...@@ -429,7 +434,7 @@ int main(int argc,char *argv[]) ...@@ -429,7 +434,7 @@ int main(int argc,char *argv[])
lan = strtol(optarg, NULL, 0); lan = strtol(optarg, NULL, 0);
if (get_language_codepage(PRIMARYLANGID(lan), SUBLANGID(lan)) == -1) if (get_language_codepage(PRIMARYLANGID(lan), SUBLANGID(lan)) == -1)
error("Language %04x is not supported\n", lan); error("Language %04x is not supported\n", lan);
currentlanguage = new_language(PRIMARYLANGID(lan), SUBLANGID(lan)); defaultlanguage = new_language(PRIMARYLANGID(lan), SUBLANGID(lan));
} }
break; break;
case 'f': case 'f':
...@@ -492,8 +497,8 @@ int main(int argc,char *argv[]) ...@@ -492,8 +497,8 @@ int main(int argc,char *argv[])
(debuglevel & DEBUGLEVEL_PPMSG) != 0 ); (debuglevel & DEBUGLEVEL_PPMSG) != 0 );
/* Check if the user set a language, else set default */ /* Check if the user set a language, else set default */
if(!currentlanguage) if(!defaultlanguage)
currentlanguage = new_language(0, 0); defaultlanguage = new_language(0, 0);
atexit(cleanup_files); atexit(cleanup_files);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment