Jean-Christophe Cardot : winhlp32: Fix some images not shown in certain 16-bit help files.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 18 10:37:02 CDT 2016
Module: wine
Branch: master
Commit: 91f89b4f96674024b3436423ddb188e838d1ca54
URL: http://source.winehq.org/git/wine.git/?a=commit;h=91f89b4f96674024b3436423ddb188e838d1ca54
Author: Jean-Christophe Cardot <wine at cardot.net>
Date: Fri Apr 15 12:08:03 2016 +0200
winhlp32: Fix some images not shown in certain 16-bit help files.
Subfiles with bitmap images are usually prefixed with '|', but sometimes not.
Signed-off-by: Jean-Christophe Cardot <wine at cardot.net>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/winhlp32/hlpfile.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c
index 10484a9..2748e5c 100644
--- a/programs/winhlp32/hlpfile.c
+++ b/programs/winhlp32/hlpfile.c
@@ -507,6 +507,18 @@ static BOOL HLPFILE_FindSubFile(HLPFILE* hlpfile, LPCSTR name, BYTE **subbuf, BY
WINE_TRACE("looking for file '%s'\n", name);
ptr = HLPFILE_BPTreeSearch(hlpfile->file_buffer + GET_UINT(hlpfile->file_buffer, 4),
name, comp_FindSubFile);
+ if (!ptr)
+ { /* Subfiles with bitmap images are usually prefixed with '|', but sometimes not.
+ Unfortunately, there is no consensus among different pieces of unofficial
+ documentation. So remove leading '|' and try again. */
+ CHAR c = *name++;
+ if (c == '|')
+ {
+ WINE_TRACE("not found. try '%s'\n", name);
+ ptr = HLPFILE_BPTreeSearch(hlpfile->file_buffer + GET_UINT(hlpfile->file_buffer, 4),
+ name, comp_FindSubFile);
+ }
+ }
if (!ptr) return FALSE;
*subbuf = hlpfile->file_buffer + GET_UINT(ptr, strlen(name)+1);
if (*subbuf >= hlpfile->file_buffer + hlpfile->file_buffer_size)
More information about the wine-cvs
mailing list