Summary: | Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Don Olmstead <don.olmstead> | ||||||
Component: | Web Template Framework | Assignee: | Don Olmstead <don.olmstead> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | annulen, benjamin, cdumez, cmarcelo, commit-queue, darin, dbates, ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Don Olmstead
2019-04-25 13:33:58 PDT
Created attachment 368260 [details]
Patch
Created attachment 368265 [details]
Patch
(In reply to Don Olmstead from comment #0) > Within the JSC tests strcasestr is used. This function is not available on > Windows. To support compilation on Windows we should emulate strcasestr > within WTF. It's more convenient to have such justifications right inside commit message (and changelog). When I personally make a patch which requires justification, I first write it inside git commit message and then copy it to bugzilla as a first comment Comment on attachment 368265 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368265&action=review > Source/WTF/wtf/text/StringCommon.h:469 > +inline size_t findIgnoringASCIICaseWithoutLength(const char* source, const char* matchCharacters) Looking at the other *WithoutLength functions, I wonder if `source` should have a templated type (i.e. const StringClass&)? Comment on attachment 368265 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368265&action=review >> Source/WTF/wtf/text/StringCommon.h:469 >> +inline size_t findIgnoringASCIICaseWithoutLength(const char* source, const char* matchCharacters) > > Looking at the other *WithoutLength functions, I wonder if `source` should have a templated type (i.e. const StringClass&)? AFAIU other *WithoutLength functions use StringClass as a placeholder of C++ string class like String or AtomicString, primitive const char* is always explicit there Comment on attachment 368265 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368265&action=review >>> Source/WTF/wtf/text/StringCommon.h:469 >>> +inline size_t findIgnoringASCIICaseWithoutLength(const char* source, const char* matchCharacters) >> >> Looking at the other *WithoutLength functions, I wonder if `source` should have a templated type (i.e. const StringClass&)? > > AFAIU other *WithoutLength functions use StringClass as a placeholder of C++ string class like String or AtomicString, primitive const char* is always explicit there Also strlen needs to be called. Comment on attachment 368265 [details] Patch Clearing flags on attachment: 368265 Committed r244694: <https://trac.webkit.org/changeset/244694> All reviewed patches have been landed. Closing bug. |