Subject: [octave ] LOADPATH recurses only one level of subdirectories
From: "John W. Eaton" <[email-masked]>
To: "Larrie Carr" <[email-masked]>
Cc: <[email-masked]>
Date: Thu, 9 Feb 2006 15:25:35 -0500

On  9-Feb-2006, Larrie Carr wrote:

| In short, octave-forge is non-functional as it uses multiple subdirectories.

If that's true for everyone, then I'm surprised as I think you are the
first to report it.

| I've been looking through the sources and nothing has sprung up.  Did find a 
| cut-and-paste code error in oct_file_in_path() in utils.cc where the string 
| length is not properly checked.  Look like a cut and paste from 
| fcn_file_in_path().  But this is for a different group.

Probably the code you are looking for is the function do_subdir in
liboctave/kpse.cc.  This file contains a stripped-down version of the
kpathsearch library.  Most modifications were to remove TeX-specific
stuff and to convert it to use std::string instead of plain C strings
which historically leaked memory.  In any case, that function may use
an optimization to decide when to check for subdirectories.  The
optimization looks at the link count of the current directory.  If it
is 2, then the assumption is that the current directory does not
contain any subdirectories.  That seems to work fine for Unixy
systems.  Does that assumption not hold for Cygwin?  If so, then I
think the fix is fairly simple as there is also Windows-specific code
in that function.  Whether the optimization is performed depends on
what is #defined at compile time, so you'll probably have to do some
checking on a Cygwin system to see what is really going on.

| int len = name.length();
| 
| if( len > 0) {
|    if (len >2 && name [ len-4] == '.' && name [len-3] == 'o'
|       && name[len-2] == 'c' && name [len-1] =='t') 

I've fixed this in my sources.

If you find other bugs in Octave, please report them to
[email-masked].

Thanks,

jwe

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/