diff src/sysdep.cc @ 6116:b64fb24bf4a0

[project @ 2006-10-27 18:04:49 by jwe]
author jwe
date Fri, 27 Oct 2006 18:04:50 +0000
parents 4278b170b9f9
children 1504e68cf080
line wrap: on
line diff
--- a/src/sysdep.cc	Fri Oct 27 17:58:06 2006 +0000
+++ b/src/sysdep.cc	Fri Oct 27 18:04:50 2006 +0000
@@ -775,7 +775,23 @@
   int nargin = args.length ();
 
   if (nargin == 1)
-    retval = file_ops::tilde_expand (args(0).all_strings ());
+    {
+      octave_value arg = args(0);
+
+      string_vector sv = arg.all_strings ();
+
+      if (! error_state)
+	{
+	  sv = file_ops::tilde_expand (sv);
+
+	  if (arg.is_cellstr ())
+	    retval = Cell (arg.dims (), sv);
+	  else
+	    retval = sv;
+	}
+      else
+	error ("tilde_expand: expecting argument to be char or cellstr object");
+    }
   else
     print_usage ();