From 38ab5f9b2c90f9be32a0fe32fad3d3be11675558 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 26 Mar 2022 18:13:18 +0000 Subject: [PATCH] Fix iverilog-vpi on Windows to handle more than one source file (issue #602) Use the string containing the current source file path to derive the object file name, not the string containing the space-separated list of source files. (thanks to DavidC-75 for pointing out the error) (cherry picked from commit 7dcde374754c4af58aaa2834e6185382616ac02d) --- driver-vpi/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/driver-vpi/main.c b/driver-vpi/main.c index 19ed5cbe7..581773541 100644 --- a/driver-vpi/main.c +++ b/driver-vpi/main.c @@ -1,6 +1,6 @@ /* + * Copyright (c) 2015-2022 Martin Whitaker * Copyright (c) 2002 Gus Baldauf (gus@picturel.com) - * Copyright (c) 2015 Martin Whitaker * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -564,10 +564,10 @@ static void compile(char *pSource, char *pFlags, char **pObject, int *compile_er assignn(&src, ptr1, len); /* Build the object file name */ - ostart = strrchr(ptr1, '/'); - if (ostart == NULL) ostart = ptr1; + ostart = strrchr(src, '/'); + if (ostart == NULL) ostart = src; else ostart += 1; - olen = strrchr(ptr1, '.') - ostart; + olen = strrchr(ostart, '.') - ostart; assignn(&obj, ostart, olen); append(&obj, ".o");