Jinoh Kang : c2man: Recognize file extensions in forward specifications.

Alexandre Julliard julliard at winehq.org
Thu Apr 7 16:07:11 CDT 2022


Module: tools
Branch: master
Commit: 0a9f1e2e899e98f34c162e4340f498736b61142b
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=0a9f1e2e899e98f34c162e4340f498736b61142b

Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date:   Fri Apr  8 01:04:52 2022 +0900

c2man: Recognize file extensions in forward specifications.

Today, c2man assumes that there is no file extension in the DLL name
part of a forward specification.  This causes forwarded exports to
krnl386.exe16 from kernel32 to be recognized incorrectly.
For example, the spec index file for kernel32 contains the following
incorrect entry:

    VxDCall0() (forwarded to exe16.VxDCall0() in krnl386())

Fix this by correctly handling DLL names with file extensions in forward
specifications.  We omit the extension in the link destination, but not
the link text itself.  The line above is now changed into:

    VxDCall0() (forwarded to VxDCall0() in {{krnl386.exe16}}{{krnl386}})

We switch to the double-brace syntax for the DLL hyperlink, since the
"<id>()" syntax cannot accept strings with dots in them.

Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 c2man.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/c2man.pl b/c2man.pl
index 0fe9e78..883a888 100755
--- a/c2man.pl
+++ b/c2man.pl
@@ -1229,9 +1229,9 @@ sub output_spec($)
       # @$_ => ordinal, call convention, exported name, implementation name, flags;
       if (@$_[$EXPORT_CALL] eq "forward")
       {
-        my $forward_dll = @$_[$EXPORT_IMPNAME];
-        $forward_dll =~ s/\.(.*)//;
-        $line = @$_[$EXPORT_EXPNAME]." (forward to ".$1."() in ".$forward_dll."())";
+        if (@$_[$EXPORT_IMPNAME] =~ /^(?:([^.]*)((?:\..*)?)\.)?([^.]*)$/) {
+          $line = @$_[$EXPORT_EXPNAME]." (forward to ".$3."() in {{".$1.$2."}}{{".$1."}})";
+        }
       }
       elsif (@$_[$EXPORT_CALL] eq "extern")
       {




More information about the wine-cvs mailing list