bugGNU Octave - Bugs: bug #48035, function what() cannot list class...

 
 

bug #48035: function what() cannot list class directories

Submitter:  None
Submitted:  Fri 27 May 2016 02:18:05 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 08 Jun 2016 09:47:43 PM UTC, comment #6: 
Mike Miller <mtmiller>
Group Member
Wed 08 Jun 2016 09:47:20 PM UTC, comment #5: 

Lachlan, I pushed your changeset, thanks to both of you.

Mike Miller <mtmiller>
Group Member
Sun 29 May 2016 03:59:43 PM UTC, comment #4: 

I got a direct email reply, no attribution necessary.

Mike Miller <mtmiller>
Group Member
Sun 29 May 2016 01:44:44 AM UTC, comment #3: 

Mike, we can wait a while for a reply, but since Savannah doesn't have an email address for the original poster, he or she is likely not to receive your question.

Lachlan Andrew <lachlan>
Sat 28 May 2016 08:34:55 PM UTC, comment #2: 

Anonymous reporter, do you want to be credited (name and email) for this one-line patch?

Mike Miller <mtmiller>
Group Member
Sat 28 May 2016 07:50:06 AM UTC, comment #1: 

Here is a Mercurial changeset containing the patch.  Thanks Anonymous.

(file #37294)

Lachlan Andrew <lachlan>
Fri 27 May 2016 02:18:05 AM UTC, original submission:  

For example this code will produce the bug:

octave:1> what /usr/share/octave/4.0.2/m/audio
M-files in directory /usr/share/octave/4.0.2/m/audio:

   lin2mu.m     record.m     soundsc.m    wavwrite.m
   mu2lin.m     sound.m      wavread.m


Possible solution:

--- /usr/share/octave/4.0.2/m/miscellaneous/what.m
+++ what.m
@@ -116,7 +116,7 @@
         w.oct{end+1} = n;
       elseif (strcmp (e, mexext ()))
         w.mex{end+1} = n;
-      elseif (n(1) == "@" && isdir (n))
+      elseif (n(1) == "@" && isdir (fullfile (dir, n)))
         w.classes{end+1} = n;
       endif
     endif


Then the correct result is:

octave:2> what /usr/share/octave/4.0.2/m/audio
M-files in directory /usr/share/octave/4.0.2/m/audio:

   lin2mu.m     record.m     soundsc.m    wavwrite.m
   mu2lin.m     sound.m      wavread.m

Classes in directory /usr/share/octave/4.0.2/m/audio:

   @audioplayer     @audiorecorder


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #37294:  bug_48035_what.cset added by lachlan (842B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by lachlan (Updated 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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-08 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-05-28 lachlan StatusNone Patch Submitted
    2016-05-28 lachlan Attached File- Added bug_48035_what.cset, #37294

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code