Bug 303428
| Summary: | CString.isEmpty() for String.utf8() returns true when String has a single character | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | ankshit <ankshit_jain> |
| Component: | New Bugs | Assignee: | Xabier RodrÃguez Calvar <calvaris> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | achristensen, calvaris, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 289787 | ||
ankshit
CString.isEmpty() for String.utf8() returns true when String has a single character.
```
String s = "a"_s;
CString utf8 = s.utf8();
utf8.isEmpty() // true, should be false
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alex Christensen
Seems to be broken since https://commits.webkit.org/303011@main
We should probably return true if the length is 0 or the length is 1 and the contents are the null terminator character. Right now we don't check for the null terminator.
Xabier RodrÃguez Calvar
Pull request: https://github.com/WebKit/WebKit/pull/54762
EWS
Committed 303840@main (1c43f6f71325): <https://commits.webkit.org/303840@main>
Reviewed commits have been landed. Closing PR #54762 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/165770081>