[Bug 38558] cmd.exe bundled with Windows XP messed up when using FOR /F

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jul 15 09:06:00 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=38558

--- Comment #10 from katsunori.kumatani at gmail.com ---
Nevermind the check above: it doesn't handle some corner cases I messed around
with. A proper one would be something like:

if((UINT_PTR)(src - (unsigned char*)dst) < dstlen * sizeof(*dst))

This handles all cases where dst is "behind" src and touches src at a point
(within dstlen), again relying on 2's complement to have efficient check (only
one branch) in case performance is a worry for small strings.

It doesn't handle cases where they still overlap but with dst "in front" of
src, but in those cases, I don't think the fast path corrupts anything more
than doing it 1 byte at a time... so we can omit that case, but maybe I'm
wrong?

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list