diff scripts/miscellaneous/movefile.m @ 11300:4ecc7bc5bc83

search PATH from environment for programs, not EXEC_PATH
author John W. Eaton <jwe@octave.org>
date Fri, 26 Nov 2010 02:58:16 -0500
parents 95c3e38098bf
children fd0a3ac60b0e
line wrap: on
line diff
--- a/scripts/miscellaneous/movefile.m	Fri Nov 26 02:45:24 2010 -0500
+++ b/scripts/miscellaneous/movefile.m	Fri Nov 26 02:58:16 2010 -0500
@@ -39,7 +39,8 @@
   ## FIXME -- maybe use the same method as in ls to allow users control
   ## over the command that is executed.
 
-  if (ispc () && ! isunix () && isempty (file_in_path (EXEC_PATH, "mv.exe")))
+  if (ispc () && ! isunix ()
+      && isempty (file_in_path (getenv ("PATH"), "mv.exe")))
     ## Windows.
     cmd = "cmd /C move";
     cmd_force_flag = "/Y";
@@ -92,7 +93,8 @@
           f1(1) = [];
         endwhile 
 
-        if (ispc () && ! isunix () && ! isempty (file_in_path (EXEC_PATH, "cp.exe")))
+        if (ispc () && ! isunix ()
+            && ! isempty (file_in_path (getenv ("PATH"), "cp.exe")))
           p1 = strrep (p1, "\\", "/");
           p2 = strrep (p2, "\\", "/");
         endif
@@ -105,7 +107,8 @@
         endif
       endwhile
     else
-      if (ispc () && ! isunix () && ! isempty (file_in_path (EXEC_PATH, "cp.exe")))
+      if (ispc () && ! isunix ()
+          && ! isempty (file_in_path (getenv_path ("PATH"), "cp.exe")))
         p1 = strrep (p1, "\\", "/");
         p2 = strrep (p2, "\\", "/");
       endif