Commit 1c33835a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp60: Fixed basic_string::c_str implementation.

parent 3b69e28a
......@@ -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++;
......
......@@ -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 */
......
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