bugGNU Octave - Bugs: bug #40332, which function sometimes returns...

 
 

bug #40332: which function sometimes returns relative pathname

Submitter:  Richard <crobar>
Submitted:  Mon 21 Oct 2013 07:07:54 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  mtmiller
Originator Name:  Richard Crozier Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 02 Nov 2013 06:47:36 PM UTC, comment #6: 

Forgot about this one for a few days. Fixed in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/c2d9d42f4fe1

Mike Miller <mtmiller>
Group Member
Wed 30 Oct 2013 01:33:44 AM UTC, comment #5: 

I only see do_which being called from dbstatus and _which_, so AFAICT it's safe, at least nothing else in Octave is expecting a relative path.

The Matlab help at

http://www.mathworks.com/help/matlab/ref/which.html

says that it always returns a full path.

Mike Miller <mtmiller>
Group Member
Tue 29 Oct 2013 03:52:14 AM UTC, comment #4: 

Mike, your change seems fine to me as long as there aren't times when this function is expected to return relative file names.

John W. Eaton <jwe>
Group administrator
Tue 29 Oct 2013 03:19:40 AM UTC, comment #3: 

How about the attached change fixing it at a slightly lower level instead?

I see you updated the docstring as well. The new paragraph you added is a little unclear, it seems to imply that which only works for function files (m-files), but it also works with arbitrary files of any type, as well as built-in functions and functions in oct-files.

(file #29497)

Mike Miller <mtmiller>
Group Member
Tue 22 Oct 2013 12:16:55 PM UTC, comment #2: 

I've now uploaded a revised patch which also adds help for the function call syntax.

Richard <crobar>
Tue 22 Oct 2013 11:50:56 AM UTC, comment #1: 

Ignore the first patch, there are mistakes in it, I'm working on an improvement.

Richard <crobar>
Mon 21 Oct 2013 07:07:54 PM UTC, original submission:  

'which mfile.m' returns a relative path to the file when that file is in the current directory. In Matlab this is always an absolute path.

Richard <crobar>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #29497:  bug40332.diff added by mtmiller (345B - text/x-patch)
file #29441:  which_canon_path.patch added by crobar (3KiB - text/x-patch)
file #29440:  which_canon_path.patch added by crobar (757B - text/x-patch - added changeset to force canonical path)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by crobar (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-11-02 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2013-10-30 mtmiller Assigned toNone mtmiller
    2013-10-29 mtmiller Attached File- Added bug40332.diff, #29497
    2013-10-22 crobar Attached File- Added which_canon_path.patch, #29441
    2013-10-22 jwe StatusNone Patch Submitted
    2013-10-22 crobar Attached File- Added which_canon_path.patch, #29440

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code