octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in file_in_path() ?


From: John W. Eaton
Subject: Re: Bug in file_in_path() ?
Date: Tue, 7 Nov 2006 15:36:04 -0500

On  7-Nov-2006, Michael Goffioul wrote:

| John W. Eaton a écrit :
| > On  7-Nov-2006, address@hidden wrote:
| >
| > | Is it normal that file_in_path() (from utils.cc) unconditionnally returns
| > | the empty string? This makes \"exist\" fails to detect regular files.
| >
| > No.  Please send an example of precisely what you are trying and how
| > it fails.
| >   
| 
| I'm trying to test if a regular file exists in the current octave's 
| path. This should
| be possible with exist() function, as stated by the documentation. This 
| fails
| because:
|     - Fexist() calls symbol_exist()
|     - symbol_exist() calls file_in_path()
|     - file_in_path() returns "" unconditionally

OK, even when I looked at the file_in_path function I was completely
missing the "return std::string ()" line.  That should not be there.

Thanks,

jwe


src/ChangeLog

2006-11-07  John W. Eaton  <address@hidden>

        * utils.cc (file_in_path): Don't unconditionally return "".


Index: src/utils.cc
===================================================================
RCS file: /cvs/octave/src/utils.cc,v
retrieving revision 1.194
diff -u -u -r1.194 utils.cc
--- src/utils.cc        22 Jun 2006 00:57:28 -0000      1.194
+++ src/utils.cc        7 Nov 2006 20:34:00 -0000
@@ -399,8 +399,6 @@
   if (! suffix.empty ())
     nm.append (suffix);
 
-  return std::string ();
-
   return octave_env::make_absolute
     (load_path::find_file (nm), octave_env::getcwd ());
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]