changeset 16040:003100ee9e0d stable

* edit.m: Undo string escape sequences on values used in sprintf formats.
author John W. Eaton <jwe@octave.org>
date Sat, 09 Feb 2013 16:08:33 -0500
parents bbef6907d766
children 0ab55e17a47b
files scripts/miscellaneous/edit.m
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/edit.m	Mon Feb 11 11:46:38 2013 -0500
+++ b/scripts/miscellaneous/edit.m	Sat Feb 09 16:08:33 2013 -0500
@@ -206,10 +206,11 @@
   if (nargin < 1)
     if (exist (FUNCTION.HOME, "dir") == 7 && (isunix () || ! ispc ()))
       system (cstrcat ("cd \"", FUNCTION.HOME, "\" ; ",
-                      sprintf (FUNCTION.EDITOR, "")),
+                      sprintf (undo_string_escapes (FUNCTION.EDITOR), "")),
               [], FUNCTION.MODE);
     else
-      system (sprintf (FUNCTION.EDITOR,""), [], FUNCTION.MODE);
+      system (sprintf (undo_string_escapes (FUNCTION.EDITOR), ""),
+              [], FUNCTION.MODE);
     endif
     return;
   endif
@@ -279,7 +280,8 @@
     ## If the file exists, then edit it.
     if (FUNCTION.EDITINPLACE)
       ## Edit in place even if it is protected.
-      system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
+      system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
+                       cstrcat ("\"", fileandpath, "\"")),
               [], FUNCTION.MODE);
       return;
     else
@@ -296,7 +298,8 @@
       else
         fclose (fid);
       endif
-      system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
+      system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
+                       cstrcat ("\"", fileandpath, "\"")),
               [], FUNCTION.MODE);
       return;
     endif
@@ -312,7 +315,8 @@
     case {"cc", "m"}
       0;
     otherwise
-      system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
+      system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
+                       cstrcat ("\"", fileandpath, "\"")),
               [], FUNCTION.MODE);
       return;
   endswitch
@@ -459,7 +463,8 @@
   fclose (fid);
 
   ## Finally we are ready to edit it!
-  system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),
+  system (sprintf (undo_string_escapes (FUNCTION.EDITOR),
+                   cstrcat ("\"", fileandpath, "\"")),
           [], FUNCTION.MODE);
 
 endfunction