From f1b01009a4d6468f4688a4786752edfcd7899d04 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 7 Apr 2009 21:20:47 -0700 Subject: [PATCH] SET LOCALE: Don't use lex_tokstr() after skipping to next token. The return value from lex_tokstr() is only valid until the next call to lex_get() (or another function that changes the current token), so don't advance past the token until we're done with its string value. --- src/language/utilities/set.q | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/language/utilities/set.q b/src/language/utilities/set.q index e8cdf1aa..d264a00e 100644 --- a/src/language/utilities/set.q +++ b/src/language/utilities/set.q @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -376,8 +376,6 @@ stc_custom_locale (struct lexer *lexer, struct dataset *ds UNUSED, s = lex_tokstr (lexer); - lex_get (lexer); - /* First try this string as an encoding name */ if ( valid_encoding (ds_cstr (s))) set_default_encoding (ds_cstr (s)); @@ -393,6 +391,8 @@ stc_custom_locale (struct lexer *lexer, struct dataset *ds UNUSED, return 0; } + lex_get (lexer); + return 1; } -- 2.30.2