comparison scripts/miscellaneous/run.m @ 19996:10392528396c

run.m: Use single quotes so that '\' isn't an escape sequence (bug #44671). * run.m: Use single quotes around script name that is sourced so that windows directory separator '\' isn't interpreted as an escape sequence.
author Rik <rik@octave.org>
date Mon, 30 Mar 2015 15:37:58 -0700
parents 9fc020886ae9
children df437a52bcaf
comparison
equal deleted inserted replaced
19995:185e8dbdaa40 19996:10392528396c
62 if (exist (d, "dir")) 62 if (exist (d, "dir"))
63 startdir = pwd (); 63 startdir = pwd ();
64 d = canonicalize_file_name (d); 64 d = canonicalize_file_name (d);
65 unwind_protect 65 unwind_protect
66 cd (d); 66 cd (d);
67 evalin ("caller", sprintf ('source ("%s%s");', f, ext), 67 evalin ("caller", sprintf ("source ('%s%s');", f, ext),
68 "rethrow (lasterror ())"); 68 "rethrow (lasterror ())");
69 unwind_protect_cleanup 69 unwind_protect_cleanup
70 if (strcmp (d, pwd ())) 70 if (strcmp (d, pwd ()))
71 cd (startdir); 71 cd (startdir);
72 endif 72 endif
79 script = which (script); 79 script = which (script);
80 else 80 else
81 ## Search PATH with null extension ('.' will be stripped and ext = "") 81 ## Search PATH with null extension ('.' will be stripped and ext = "")
82 script = which ([script "."]); 82 script = which ([script "."]);
83 endif 83 endif
84 evalin ("caller", sprintf ('source ("%s");', script), 84 evalin ("caller", sprintf ("source ('%s');", script),
85 "rethrow (lasterror ())"); 85 "rethrow (lasterror ())");
86 endif 86 endif
87 endfunction 87 endfunction
88 88
89 89