bugGNU Octave - Bugs: bug #30377, find_in_path() Misses first...


bug #30377: find_in_path() Misses first character in path list

Submitted by:  None
Submitted on:  Wed 07 Jul 2010 08:56:41 AM UTC  
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Octave Forge Assigned to:  None
Originator Name:  Tobias Kiertscher Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  3.2.4
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 08 Jul 2010 05:31:43 PM UTC, comment #5: 

THat should read

pkg rebuild -noauto oct2mat
pkg unload oct2mat


David Bateman <dbateman>
Project Member
Thu 08 Jul 2010 05:01:08 PM UTC, comment #4: 

The oct2mat package is useful when converting Octave code for use with matlab, so it shouldn't be used in Octave itself. Alois is overhauling the oct2mat package at the moment and hopefully this problem will go away in a future version.

For now do the following

pkg -noauto oct2mat
pkg unload oct2mat

and the oct2mat functions will be removed from your path permenantly. I'm assigning this bug to octave-forge, putting Alois in copy to this bug and closing it


David Bateman <dbateman>
Project Member
Thu 08 Jul 2010 04:44:51 PM UTC, comment #3: 

Yeah, the oct2mat package screws up a lot of stuff, and is biting people in the ass quite often.  I think it is a real problem.  What can we do to eliminate that as a problem for people who download the binary package of 3.2.4 for Windows, especially, where this seems to be the biggest problem, typically for the least experienced users?

John W. Eaton <jwe>
Project Administrator
Thu 08 Jul 2010 08:11:07 AM UTC, comment #2: 

Sorry, of course its 'file_in_path' and I should have been more precise. The bug is in the file:


It seems, that the oct2mat package is overriding the build-in-function.

I'm new to bug reporting but I found this weird behavior and even a solution so I thought today is the day I can do my stint. :-)

Tobias Kiertscher <cytrek83>
Wed 07 Jul 2010 07:06:17 PM UTC, comment #1: 

There doesn't appear that there is a find_in_path function in Octave. I think you mean file_in_path, which is a built-in function. I therefore don't understand your proposed change, which is in an octave syntax, where file_in_path is defined from src/utils.cc

Maybe you have another version of file_in_path that is buggy in your path. Can you tell me where file_in_path.m is located in your version of Octave? Can you tell me what "which file_in_path" returns in Octave?


David Bateman <dbateman>
Project Member
Wed 07 Jul 2010 08:56:41 AM UTC, original submission:  

The second line of the function find_in_path() needs to be

  idx=[0 findstr(p,pathsep) length(p)+1];

instead of

  idx=[1 findstr(p,pathsep) length(p)+1];

to catch the first character in p.

I found the bug while trying imread() on Windows where the pathlist is IMAGE_PATH = '.;C:\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\imagelib'. And because of the buggy find_in_path() imread() never find images in current directory.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by dbateman
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by cytrek83 (Posted a comment)
  • -email is unavailable- added by dbateman (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-08 dbateman StatusNeed Info => Octave Forge
        Open/ClosedOpen => Closed
        Carbon-Copy- => Added alois.schloegl@tugraz.at
    2010-07-07 dbateman StatusNone => Need Info

    Back to the top

    Powered by Savane 3.5