On Mon, Mar 12, 2018 at 09:25:25AM +0000, Huw Davies wrote:
On Thu, Mar 08, 2018 at 02:35:59PM -0500, Sergio Gómez Del Real wrote:
+ if (flags & FIND_FROMSTART) + { + int j; + for (j = 0; j < src_size; j++) + { + if (CompareStringEx(localename, mask, src + j, value_size, value, value_size, NULL, NULL, 0) == CSTR_EQUAL) + { + if (found) + *found = value_size; + return j; + } + } + SetLastError(ERROR_SUCCESS); + return -1; + }
And actually, with the correct settings for the start, end and increment values of the above loop, you could use it to handle all four FIND_ flags, which may end up looking rather cleaner. Huw.