msvcp60: Fixed basic_string::c_str implementation.

This commit is contained in:
Piotr Caban 2012-11-14 15:37:54 +01:00 committed by Alexandre Julliard
parent 3b69e28a89
commit 1c33835a53
2 changed files with 8 additions and 8 deletions

View File

@ -3970,7 +3970,7 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator
numpunct_wchar_grouping(numpunct, &grouping_bstr);
grouping = basic_string_char_c_str(&grouping_bstr);
sep = grouping ? numpunct_wchar_thousands_sep(numpunct) : (wchar_t)0;
sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : (wchar_t)0;
if(sep)
basic_string_char_ctor(&groups_found);
@ -4124,7 +4124,7 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator
numpunct_wchar_grouping(numpunct, &grouping_bstr);
grouping = basic_string_char_c_str(&grouping_bstr);
sep = grouping ? numpunct_wchar_thousands_sep(numpunct) : '\0';
sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : '\0';
basefield = fmtflags & FMTFLAG_basefield;
if(basefield == FMTFLAG_oct)
@ -5034,7 +5034,7 @@ static int num_get_char__Getffld(const num_get *this, char *dest, istreambuf_ite
numpunct_char_grouping(numpunct, &grouping_bstr);
grouping = basic_string_char_c_str(&grouping_bstr);
sep = grouping ? numpunct_char_thousands_sep(numpunct) : '\0';
sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
if(sep)
basic_string_char_ctor(&groups_found);
@ -5186,7 +5186,7 @@ static int num_get_char__Getifld(const num_get *this, char *dest, istreambuf_ite
numpunct_char_grouping(numpunct, &grouping_bstr);
grouping = basic_string_char_c_str(&grouping_bstr);
sep = grouping ? numpunct_char_thousands_sep(numpunct) : '\0';
sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
basefield = fmtflags & FMTFLAG_basefield;
if(basefield == FMTFLAG_oct)
@ -5949,7 +5949,7 @@ static ostreambuf_iterator_char* num_put_char_fput(const num_put *this, ostreamb
/* Add separators to number */
numpunct_char_grouping(numpunct, &grouping_bstr);
grouping = basic_string_char_c_str(&grouping_bstr);
sep = grouping ? numpunct_char_thousands_sep(numpunct) : '\0';
sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
group_size++;
@ -6032,7 +6032,7 @@ static ostreambuf_iterator_char* num_put_char__Iput(const num_put *this, ostream
/* Add separators to number */
numpunct_char_grouping(numpunct, &grouping_bstr);
grouping = basic_string_char_c_str(&grouping_bstr);
sep = grouping ? numpunct_char_thousands_sep(numpunct) : '\0';
sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
for(p=buf+count-1; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
group_size++;

View File

@ -1666,7 +1666,7 @@ DEFINE_THISCALL_WRAPPER(basic_string_char_c_str, 4)
const char* __thiscall basic_string_char_c_str(const basic_string_char *this)
{
TRACE("%p\n", this);
return this->ptr;
return this->ptr ? this->ptr : basic_string_char__Nullstr();
}
/* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
@ -3376,7 +3376,7 @@ DEFINE_THISCALL_WRAPPER(basic_string_wchar_c_str, 4)
const wchar_t* __thiscall basic_string_wchar_c_str(const basic_string_wchar *this)
{
TRACE("%p\n", this);
return this->ptr;
return this->ptr ? this->ptr : basic_string_wchar__Nullstr();
}
/* ?size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */