wrc: Reset the language before processing multiple rc files. (3rd try)
Michael Stefaniuc
mstefani at redhat.de
Fri Jul 10 05:03:30 CDT 2009
---
There goes my julliard factor down the drain ...
Changes to previous version:
- Copy the content of that language struct and not the pointer.
tools/wrc/wrc.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c
index 61a3734..a698370 100644
--- a/tools/wrc/wrc.c
+++ b/tools/wrc/wrc.c
@@ -132,6 +132,7 @@ int extensions = 1;
/*
* Language setting for resources (-l option)
*/
+language_t *defaultlanguage = NULL;
language_t *currentlanguage = NULL;
/*
@@ -250,6 +251,9 @@ static int load_file( const char *input_name, const char *output_name )
{
int ret;
+ /* Reset the language */
+ *currentlanguage = *defaultlanguage;
+
/* Run the preprocessor on the input */
if(!no_preprocess)
{
@@ -429,7 +433,7 @@ int main(int argc,char *argv[])
lan = strtol(optarg, NULL, 0);
if (get_language_codepage(PRIMARYLANGID(lan), SUBLANGID(lan)) == -1)
error("Language %04x is not supported\n", lan);
- currentlanguage = new_language(PRIMARYLANGID(lan), SUBLANGID(lan));
+ defaultlanguage = new_language(PRIMARYLANGID(lan), SUBLANGID(lan));
}
break;
case 'f':
@@ -492,8 +496,9 @@ int main(int argc,char *argv[])
(debuglevel & DEBUGLEVEL_PPMSG) != 0 );
/* Check if the user set a language, else set default */
- if(!currentlanguage)
- currentlanguage = new_language(0, 0);
+ if(!defaultlanguage)
+ defaultlanguage = new_language(0, 0);
+ currentlanguage = dup_language(defaultlanguage);
atexit(cleanup_files);
--
1.6.1.1
More information about the wine-patches
mailing list