comparison src/octave-6-fixes.patch @ 2966:26638973a661

make edit work with backslashes in editor file name
author John W. Eaton <jwe@octave.org>
date Thu, 24 Jan 2013 17:39:30 -0500
parents
children
comparison
equal deleted inserted replaced
2965:d35eda9fb1f3 2966:26638973a661
1 diff -uNr a/scripts/miscellaneous/edit.m b/scripts/miscellaneous/edit.m
2 --- a/scripts/miscellaneous/edit.m 2012-11-13 12:31:48.000000000 -0500
3 +++ b/scripts/miscellaneous/edit.m 2013-01-24 17:37:50.597434926 -0500
4 @@ -243,10 +243,11 @@
5 if (nargin < 1)
6 if (exist (FUNCTION.HOME, "dir") == 7 && (isunix () || ! ispc ()))
7 system (cstrcat ("cd \"", FUNCTION.HOME, "\" ; ",
8 - sprintf (FUNCTION.EDITOR, "")),
9 + sprintf (undo_string_escapes (FUNCTION.EDITOR), "")),
10 [], FUNCTION.MODE);
11 else
12 - system (sprintf (FUNCTION.EDITOR,""), [], FUNCTION.MODE);
13 + system (sprintf (undo_string_escapes (FUNCTION.EDITOR), ""),
14 + [], FUNCTION.MODE);
15 endif
16 return;
17 endif
18 @@ -328,7 +329,8 @@
19 ## If the file exists, then edit it.
20 if (FUNCTION.EDITINPLACE)
21 ## Edit in place even if it is protected.
22 - system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
23 + system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
24 + cstrcat ("\"", fileandpath, "\"")),
25 [], FUNCTION.MODE);
26 return;
27 else
28 @@ -345,7 +347,8 @@
29 else
30 fclose (fid);
31 endif
32 - system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
33 + system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
34 + cstrcat ("\"", fileandpath, "\"")),
35 [], FUNCTION.MODE);
36 return;
37 endif
38 @@ -361,7 +364,8 @@
39 case {"cc", "m"}
40 0;
41 otherwise
42 - system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
43 + system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
44 + cstrcat ("\"", fileandpath, "\"")),
45 [], FUNCTION.MODE);
46 return;
47 endswitch
48 @@ -512,7 +516,8 @@
49 fclose (fid);
50
51 ## Finally we are ready to edit it!
52 - system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
53 + system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
54 + cstrcat ("\"", fileandpath, "\"")),
55 [], FUNCTION.MODE);
56
57 endif