Changeset 48012 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 3, 2009, 2:38:00 AM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r48005 r48012 1 2009-09-03 Fumitoshi Ukai <[email protected]> 2 3 Reviewed by Eric Seidel. 4 5 Add strnstr for Linux and Windows in StringExtras.h 6 https://bugs.webkit.org/show_bug.cgi?id=28901 7 8 * wtf/StringExtras.h: 9 (strnstr): 10 1 11 2009-09-03 Zoltan Horvath <[email protected]> 2 12 -
trunk/JavaScriptCore/wtf/StringExtras.h
r44765 r48012 86 86 #endif 87 87 88 #if PLATFORM(WIN_OS) || PLATFORM(LINUX) 89 90 inline char* strnstr(const char* buffer, const char* target, size_t bufferLength) 91 { 92 size_t targetLength = strlen(target); 93 if (targetLength == 0) 94 return const_cast<char*>(buffer); 95 for (const char* start = buffer; *start && start + targetLength <= buffer + bufferLength; start++) { 96 if (*start == *target && strncmp(start + 1, target + 1, targetLength - 1) == 0) 97 return const_cast<char*>(start); 98 } 99 return 0; 100 } 101 102 #endif 103 88 104 #endif // WTF_StringExtras_h
Note:
See TracChangeset
for help on using the changeset viewer.