リビジョン | bc6d843f3fbf45f8535c462c9cc06766cd560156 (tree) |
---|---|
日時 | 2018-12-07 05:05:28 |
作者 | Agustina Arzille <avarzille@rise...> |
コミッター | Agustina Arzille |
Small fixes in char reading and tuple len
@@ -905,7 +905,13 @@ | ||
905 | 905 | schar tmp; |
906 | 906 | if (!this->src->sgetc (this->interp, tmp)) |
907 | 907 | raise_eos (this->interp); |
908 | - else if (!isspace (tmp.uc)) | |
908 | + else if (tmp.uc <= 0x7f && !symchar_p (tmp.uc) && got) | |
909 | + { | |
910 | + this->src->ungetuc (tmp.buf, tmp.len); | |
911 | + this->bufp[this->bufcnt] = '\0'; | |
912 | + break; | |
913 | + } | |
914 | + else if (!isspace (tmp.uc) && (symchar_p (tmp.uc) || !got)) | |
909 | 915 | { |
910 | 916 | if (!got) |
911 | 917 | cv = tmp; |
@@ -490,7 +490,8 @@ | ||
490 | 490 | |
491 | 491 | uint32_t len_o (interpreter *, object tx) |
492 | 492 | { |
493 | - return ((uint32_t)*root_plen (as_tuple(tx)->head)); | |
493 | + auto ret = *root_plen(as_tuple(tx)->head); | |
494 | + return (ret < 0 ? 0 : (uint32_t)ret); | |
494 | 495 | } |
495 | 496 | |
496 | 497 | void tuple_clr (interpreter *interp, object tx) |