From: Bruno Haible Date: Mon, 7 Oct 2024 18:15:44 +0000 (+0200) Subject: csharpexec: Improve Cygwin support. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f9269aa3a6583d3f67fa462baee68ca7de3530a2;p=gnulib.git csharpexec: Improve Cygwin support. * lib/csharpexec.c: Include cygpath.h. (execute_csharp_using_sscli): Convert the first 'clix' argument to native Windows syntax. * modules/csharpexec (Depends-on): Add cygpath. --- diff --git a/ChangeLog b/ChangeLog index 2d12dd3edf..e22466cb9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2024-10-07 Bruno Haible + csharpexec: Improve Cygwin support. + * lib/csharpexec.c: Include cygpath.h. + (execute_csharp_using_sscli): Convert the first 'clix' argument to + native Windows syntax. + * modules/csharpexec (Depends-on): Add cygpath. + csharpexec-script: Improve Cygwin support. * build-aux/csharpexec.sh.in: Convert the first 'clix' argument to native Windows syntax. diff --git a/lib/csharpexec.c b/lib/csharpexec.c index 88f9441381..c7e3fe5ae5 100644 --- a/lib/csharpexec.c +++ b/lib/csharpexec.c @@ -24,10 +24,11 @@ #include #include +#include +#include "cygpath.h" #include "execute.h" #include "sh-quote.h" #include "xmalloca.h" -#include #include "gettext.h" /* Handling of MONO_PATH is just like Java CLASSPATH. */ @@ -178,6 +179,9 @@ execute_csharp_using_sscli (const char *assembly_path, if (clix_present) { + /* Here, we assume that 'clix' is a native Windows program, therefore + we need to use cygpath_w. */ + char *assembly_path_converted = cygpath_w (assembly_path); char *old_clixpath; const char **argv = (const char **) xmalloca ((2 + nargs + 1) * sizeof (const char *)); @@ -188,7 +192,7 @@ execute_csharp_using_sscli (const char *assembly_path, old_clixpath = set_clixpath (libdirs, libdirs_count, false, verbose); argv[0] = "clix"; - argv[1] = assembly_path; + argv[1] = assembly_path_converted; for (i = 0; i <= nargs; i++) argv[2 + i] = args[i]; @@ -205,6 +209,7 @@ execute_csharp_using_sscli (const char *assembly_path, reset_clixpath (old_clixpath); freea (argv); + free (assembly_path_converted); return err; } diff --git a/modules/csharpexec b/modules/csharpexec index cb30c938fb..11dcf49edb 100644 --- a/modules/csharpexec +++ b/modules/csharpexec @@ -9,6 +9,7 @@ lib/classpath.c Depends-on: stdbool +cygpath execute xsetenv sh-quote