mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 21:10:19 +00:00
some fix
This commit is contained in:
parent
7a53ae47ee
commit
7182257413
@ -7,8 +7,7 @@ namespace pkpy{
|
||||
// Skip utf8 BOM if there is any.
|
||||
if (strncmp(source.data(), "\xEF\xBB\xBF", 3) == 0) index += 3;
|
||||
// Drop all '\r'
|
||||
// SStream ss(source.size());
|
||||
SStream ss;
|
||||
SStream ss(source.size());
|
||||
while(index < source.size()){
|
||||
if(source[index] != '\r') ss << source[index];
|
||||
index++;
|
||||
|
@ -437,6 +437,7 @@ int utf8len(unsigned char c, bool suppress){
|
||||
|
||||
Str SStream::str(){
|
||||
// after this call, the buffer is no longer valid
|
||||
buffer.reserve(buffer.size() + 1); // allocate one more byte for '\0'
|
||||
return Str(buffer.detach());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user