Mercurial > hg > octave-lyh
diff scripts/miscellaneous/copyfile.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/copyfile.m +++ b/scripts/miscellaneous/copyfile.m @@ -40,7 +40,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, "cp.exe"))) + if (ispc () && ! isunix () + && isempty (file_in_path (getenv ("PATH"), "cp.exe"))) ## Windows. cmd = "cmd /C xcopy /E"; cmd_force_flag = "/Y"; @@ -93,7 +94,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 @@ -107,7 +109,8 @@ endif endwhile else - 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