Index: programs/winhelp/hlpfile.c =================================================================== RCS file: /home/wine/wine/programs/winhelp/hlpfile.c,v retrieving revision 1.29 diff -u -p -r1.29 hlpfile.c --- programs/winhelp/hlpfile.c 23 May 2006 12:49:31 -0000 1.29 +++ programs/winhelp/hlpfile.c 10 Aug 2006 10:05:47 -0000 @@ -1498,8 +1498,17 @@ static BYTE *HLPFILE_UncompressLZ77(BYTE int code = GET_USHORT(ptr, 0); int len = 3 + (code >> 12); int offset = code & 0xfff; - memcpy(newptr, newptr - offset - 1, len); - newptr += len; + /* + * We must copy byte-by-byte here. We cannot use memcpy here - + * areas are overlaps, so it's behaviour is unpredictable + * (memcpy DOES NOT copy byte-by-byte because of some + * optimizations). + * bcopy also fails, it behaves like memmove, non memcpy. + * + * WINE versions of memcpy/memmove cannot be used by the + * same reasons. + */ + for (; len>0; len--, newptr++) *newptr = *(newptr-offset-1); ptr += 2; } else *newptr++ = *ptr++;