From ee87c91e0577346ac0a9f68ebe707509c59e0055 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 21 Dec 2010 10:04:40 +0000 Subject: (svn r21556) -Fix [FS#4320]: argt wasn't updated when argv was updated due to ARG_INDEX, so there was a mismatch between argt's offset and argv's offset causing trouble when getting the gender of a string --- src/strings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index 661afeec3..948ca5a42 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -940,9 +940,12 @@ static char *FormatString(char *buff, const char *str, int64 *argv, const int64 buff = FormatCommaNumber(buff, GetInt64(&argv, argve, &argt, SCC_COMMA), last); break; - case SCC_ARG_INDEX: // Move argument pointer - argv = argv_orig + (byte)*str++; + case SCC_ARG_INDEX: { // Move argument pointer + byte offset = (byte)*str++; + argv = argv_orig + offset; + if (argt_orig != NULL) argt = argt_orig + offset; break; + } case SCC_PLURAL_LIST: { // {P} int plural_form = *str++; // contains the plural form for this string -- cgit v1.2.3-54-g00ecf