diff src/utils.cc @ 3040:443851377f3f

[project @ 1997-06-06 09:29:28 by jwe]
author jwe
date Fri, 06 Jun 1997 09:34:14 +0000
parents 38de16594cb4
children 2280158c4449
line wrap: on
line diff
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -57,14 +57,16 @@
 
 #include "SLStack.h"
 
+#include "dir-ops.h"
+#include "file-ops.h"
 #include "file-stat.h"
 #include "oct-cmplx.h"
 #include "oct-env.h"
+#include "pathsearch.h"
 #include "str-vec.h"
 
 #include <defaults.h>
 #include "defun.h"
-#include "dir-ops.h"
 #include "dirfns.h"
 #include "error.h"
 #include "gripes.h"
@@ -72,7 +74,6 @@
 #include "oct-hist.h"
 #include "oct-obj.h"
 #include "pager.h"
-#include "pathsearch.h"
 #include "sysdep.h"
 #include "toplev.h"
 #include "unwind-prot.h"
@@ -227,9 +228,12 @@
 // See if the given file is in the path.
 
 string
-search_path_for_file (const string& path, const string& name)
+search_path_for_file (const string& path, const string& name,
+		      bool do_tilde_expansion)
 {
-  dir_path p (path);
+  string tmp_path = do_tilde_expansion ? file_ops::tilde_expand (path) : path;
+
+  dir_path p (tmp_path);
 
   return octave_env::make_absolute (p.find (name), octave_env::getcwd ());
 }
@@ -269,7 +273,7 @@
   if (! suffix.empty ())
     nm.append (suffix);
 
-  return search_path_for_file (Vload_path, nm);
+  return search_path_for_file (Vload_path, nm, false);
 }
 
 // See if there is an function file in the path.  If so, return the