diff src/file-io.cc @ 1750:fd0d12493223

[project @ 1996-01-13 09:31:07 by jwe]
author jwe
date Sat, 13 Jan 1996 09:31:07 +0000
parents a02f140ed897
children 3a9462b655f1
line wrap: on
line diff
--- a/src/file-io.cc	Sat Jan 13 09:31:07 1996 +0000
+++ b/src/file-io.cc	Sat Jan 13 09:31:07 1996 +0000
@@ -64,12 +64,11 @@
 #include "mappers.h"
 #include "oct-map.h"
 #include "oct-hist.h"
+#include "oct-obj.h"
 #include "pager.h"
 #include "statdefs.h"
 #include "sysdep.h"
 #include "syswait.h"
-#include "pt-const.h"
-#include "oct-obj.h"
 #include "utils.h"
 #include "variables.h"
 
@@ -2486,21 +2485,13 @@
 
   if (args.length () == 1)
     {
-      string tstr = args(0).string_value ();
-      const char *name = tstr.c_str ();
-
-      static char *fname = 0;
-
-      if (fname)
-	free (fname);
-
-      fname = tilde_expand (name);
+      string fname = oct_tilde_expand (args(0).string_value ());
 
       if (! error_state)
 	{
 	  struct stat buf;
 
-	  if (stat (fname, &buf) < 0)
+	  if (stat (fname.c_str (), &buf) < 0)
 	    retval = -1.0;
 	  else
 	    retval = tree_constant (mk_stat_map (buf));
@@ -2522,21 +2513,13 @@
 
   if (args.length () == 1)
     {
-      string tstr = args(0).string_value ();
-      const char *name = tstr.c_str ();
-
-      static char *fname = 0;
-
-      if (fname)
-	free (fname);
-
-      fname = tilde_expand (name);
+      string fname = oct_tilde_expand (args(0).string_value ());
 
       if (! error_state)
 	{
 	  struct stat buf;
 
-	  if (lstat (fname, &buf) < 0)
+	  if (lstat (fname.c_str (), &buf) < 0)
 	    retval = -1.0;
 	  else
 	    retval = tree_constant (mk_stat_map (buf));