changeset 30779:73404743f3de

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 25 Feb 2022 15:42:43 +0100
parents 439eb9bd4c04 (current diff) e36380193f2b (diff)
children 1fcb3359f6a4
files
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/pkg/private/configure_make.m	Thu Feb 24 22:16:35 2022 +0100
+++ b/scripts/pkg/private/configure_make.m	Fri Feb 25 15:42:43 2022 +0100
@@ -52,6 +52,19 @@
       __gripe_missing_component__ ("pkg", "octave");
     endif
 
+    if (ispc () && ! isunix ())
+      # replace all backslashes with forward slashes
+      mkoctfile_program = strrep (mkoctfile_program, '\', '/');
+      octave_config_program = strrep (octave_config_program, '\', '/');
+      octave_binary = strrep (octave_binary, '\', '/');
+    endif
+
+    # escape spaces in file paths unless they are already escaped
+    mkoctfile_program = regexprep (mkoctfile_program, '([^\\]) ', '$1\\ ');
+    octave_config_program = regexprep (octave_config_program, ...
+                                       '([^\\]) ', '$1\\ ');
+    octave_binary = regexprep (octave_binary, '([^\\]) ', '$1\\ ');
+
     if (verbose)
       mkoctfile_program = [mkoctfile_program " --verbose"];
     endif
@@ -151,7 +164,6 @@
 function [status, output] = shell (cmd, verbose)
   persistent have_sh;
 
-  cmd = strrep (cmd, '\', '/');
   if (ispc () && ! isunix ())
     if (isempty (have_sh))
       if (system ('sh.exe -c "exit"'))