| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -545,23 +545,23 @@ _Py_DumpASCII(int fd, PyObject *text) | |||
| 545 | 545 | ||
| 546 | 546 | size = ascii->length; | |
| 547 | 547 | kind = ascii->state.kind; | |
| 548 | - if (ascii->state.compact) { | ||
| 548 | + if (kind == PyUnicode_WCHAR_KIND) { | ||
| 549 | + wstr = ((PyASCIIObject *)text)->wstr; | ||
| 550 | + if (wstr == NULL) | ||
| 551 | + return; | ||
| 552 | + size = ((PyCompactUnicodeObject *)text)->wstr_length; | ||
| 553 | + } | ||
| 554 | + else if (ascii->state.compact) { | ||
| 549 | 555 | if (ascii->state.ascii) | |
| 550 | 556 | data = ((PyASCIIObject*)text) + 1; | |
| 551 | 557 | else | |
| 552 | 558 | data = ((PyCompactUnicodeObject*)text) + 1; | |
| 553 | 559 | } | |
| 554 | - else if (kind != PyUnicode_WCHAR_KIND) { | ||
| 560 | + else { | ||
| 555 | 561 | data = ((PyUnicodeObject *)text)->data.any; | |
| 556 | 562 | if (data == NULL) | |
| 557 | 563 | return; | |
| 558 | 564 | } | |
| 559 | - else { | ||
| 560 | - wstr = ((PyASCIIObject *)text)->wstr; | ||
| 561 | - if (wstr == NULL) | ||
| 562 | - return; | ||
| 563 | - size = ((PyCompactUnicodeObject *)text)->wstr_length; | ||
| 564 | - } | ||
| 565 | 565 | ||
| 566 | 566 | if (MAX_STRING_LENGTH < size) { | |
| 567 | 567 | size = MAX_STRING_LENGTH; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments