From 7f0bdc6621b38777e3acb0bf90773ffc08f42ab2 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 29 Mar 2019 15:10:00 +0100 Subject: [PATCH] rust/mingw: fix C glue code generator --- rust/gen-c-headers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/gen-c-headers.py b/rust/gen-c-headers.py index cfe303671b..b3eceb5c07 100755 --- a/rust/gen-c-headers.py +++ b/rust/gen-c-headers.py @@ -139,7 +139,9 @@ def convert_type(rs_type): raise Exception("Failed to parse Rust type: %s" % (rs_type)) def make_output_filename(filename): - parts = filename.split(os.path.sep)[2:] + if filename.startswith("./"): + filename = filename[2:] + parts = filename.split(os.path.sep)[1:] last = os.path.splitext(parts.pop())[0] outpath = "./gen/c-headers/rust-%s-%s-gen.h" % ( "-".join(parts), last) -- 2.47.2