]> Savannah Git Hosting - gnulib.git/commitdiff
csharpexec: Improve Cygwin support.
authorBruno Haible <bruno@clisp.org>
Mon, 7 Oct 2024 18:15:44 +0000 (20:15 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 16 Oct 2024 12:03:44 +0000 (14:03 +0200)
* 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.

ChangeLog
lib/csharpexec.c
modules/csharpexec

index 2d12dd3edf559638bafc70d37654d006776c78c5..e22466cb9c961a8207b118db1c242066bb386533 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-10-07  Bruno Haible  <bruno@clisp.org>
 
+       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.
index 88f94413813ef4678ca8f6a594bbfdb91266a314..c7e3fe5ae59decaae3c725367fb0f6444c9350cc 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <error.h>
+#include "cygpath.h"
 #include "execute.h"
 #include "sh-quote.h"
 #include "xmalloca.h"
-#include <error.h>
 #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;
     }
index cb30c938fb4e0152d6ffa2bfc6c3eeca1cf1a771..11dcf49edb7e41cb1205fb3d5dec251861129628 100644 (file)
@@ -9,6 +9,7 @@ lib/classpath.c
 
 Depends-on:
 stdbool
+cygpath
 execute
 xsetenv
 sh-quote