msvcp60: Fixed handling of empty strings.
This commit is contained in:
parent
4f4f93802a
commit
95c4284822
|
@ -236,6 +236,7 @@ void __thiscall basic_string_char__Split(basic_string_char *this)
|
|||
len = this->size;
|
||||
basic_string_char__Tidy(this, TRUE);
|
||||
if(basic_string_char__Grow(this, len, FALSE)) {
|
||||
if(ptr)
|
||||
char_traits_char__Copy_s(this->ptr, this->res, ptr, len);
|
||||
basic_string_char__Eos(this, len);
|
||||
}
|
||||
|
@ -345,8 +346,8 @@ basic_string_char* __thiscall basic_string_char_assign_substr(
|
|||
basic_string_char_erase(this, pos+len, basic_string_char_npos);
|
||||
basic_string_char_erase(this, 0, pos);
|
||||
} else if(basic_string_char__Grow(this, len, FALSE)) {
|
||||
char_traits_char__Copy_s(this->ptr, this->res,
|
||||
assign->ptr+pos, len);
|
||||
if(assign->ptr)
|
||||
char_traits_char__Copy_s(this->ptr, this->res, assign->ptr+pos, len);
|
||||
basic_string_char__Eos(this, len);
|
||||
}
|
||||
|
||||
|
@ -1149,8 +1150,9 @@ basic_string_char* __thiscall basic_string_char_append_substr(basic_string_char
|
|||
_Xlen();
|
||||
|
||||
if(basic_string_char__Grow(this, this->size+count, FALSE)) {
|
||||
char_traits_char__Copy_s(this->ptr+this->size,
|
||||
this->res-this->size, append->ptr+offset, count);
|
||||
if(append->ptr)
|
||||
char_traits_char__Copy_s(this->ptr+this->size, this->res-this->size,
|
||||
append->ptr+offset, count);
|
||||
basic_string_char__Eos(this, this->size+count);
|
||||
}
|
||||
|
||||
|
@ -1763,6 +1765,7 @@ MSVCP_size_t __thiscall basic_string_char_copy(const basic_string_char *this,
|
|||
_Xran();
|
||||
if(count > this->size-off)
|
||||
count = this->size-off;
|
||||
if(this->ptr)
|
||||
char_traits_char__Copy_s(dest, count, this->ptr+off, count);
|
||||
return count;
|
||||
}
|
||||
|
@ -1949,6 +1952,7 @@ void __thiscall basic_string_wchar__Split(basic_string_wchar *this)
|
|||
len = this->size;
|
||||
basic_string_wchar__Tidy(this, TRUE);
|
||||
if(basic_string_wchar__Grow(this, len, FALSE)) {
|
||||
if(ptr)
|
||||
char_traits_wchar__Copy_s(this->ptr, this->res, ptr, len);
|
||||
basic_string_wchar__Eos(this, len);
|
||||
}
|
||||
|
@ -2058,6 +2062,7 @@ basic_string_wchar* __thiscall basic_string_wchar_assign_substr(
|
|||
basic_string_wchar_erase(this, pos+len, basic_string_wchar_npos);
|
||||
basic_string_wchar_erase(this, 0, pos);
|
||||
} else if(basic_string_wchar__Grow(this, len, FALSE)) {
|
||||
if(assign->ptr)
|
||||
char_traits_wchar__Copy_s(this->ptr, this->res,
|
||||
assign->ptr+pos, len);
|
||||
basic_string_wchar__Eos(this, len);
|
||||
|
@ -2861,8 +2866,9 @@ basic_string_wchar* __thiscall basic_string_wchar_append_substr(basic_string_wch
|
|||
_Xlen();
|
||||
|
||||
if(basic_string_wchar__Grow(this, this->size+count, FALSE)) {
|
||||
char_traits_wchar__Copy_s(this->ptr+this->size,
|
||||
this->res-this->size, append->ptr+offset, count);
|
||||
if(append->ptr)
|
||||
char_traits_wchar__Copy_s(this->ptr+this->size, this->res-this->size,
|
||||
append->ptr+offset, count);
|
||||
basic_string_wchar__Eos(this, this->size+count);
|
||||
}
|
||||
|
||||
|
@ -3475,6 +3481,7 @@ MSVCP_size_t __thiscall basic_string_wchar_copy(const basic_string_wchar *this,
|
|||
_Xran();
|
||||
if(count > this->size-off)
|
||||
count = this->size-off;
|
||||
if(this->ptr)
|
||||
char_traits_wchar__Copy_s(dest, count, this->ptr+off, count);
|
||||
return count;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue