mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[c][cpp] Fix multi-page atlas parsing, closes #1935
This commit is contained in:
parent
d4c099018b
commit
8057c114db
@ -139,7 +139,10 @@ typedef struct SimpleString {
|
|||||||
static SimpleString *ss_trim(SimpleString *self) {
|
static SimpleString *ss_trim(SimpleString *self) {
|
||||||
while (isspace((unsigned char) *self->start) && self->start < self->end)
|
while (isspace((unsigned char) *self->start) && self->start < self->end)
|
||||||
self->start++;
|
self->start++;
|
||||||
if (self->start == self->end) return self;
|
if (self->start == self->end) {
|
||||||
|
self->length = self->end - self->start;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
self->end--;
|
self->end--;
|
||||||
while (((unsigned char) *self->end == '\r') && self->end >= self->start)
|
while (((unsigned char) *self->end == '\r') && self->end >= self->start)
|
||||||
self->end--;
|
self->end--;
|
||||||
|
|||||||
@ -111,7 +111,10 @@ struct SimpleString {
|
|||||||
SimpleString trim() {
|
SimpleString trim() {
|
||||||
while (isspace((unsigned char) *start) && start < end)
|
while (isspace((unsigned char) *start) && start < end)
|
||||||
start++;
|
start++;
|
||||||
if (start == end) return *this;
|
if (start == end) {
|
||||||
|
length = end - start;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
end--;
|
end--;
|
||||||
while (((unsigned char) *end == '\r') && end >= start)
|
while (((unsigned char) *end == '\r') && end >= start)
|
||||||
end--;
|
end--;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user