bugGNU Octave - Bugs: bug #48975, help on some operators fail, due...

 
 

bug #48975: help on some operators fail, due to a bug in function "which"

Submitter:  None
Submitted:  Fri 02 Sep 2016 04:23:38 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.3
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 03 Sep 2016 12:45:52 AM UTC, comment #2: 

Thank maintainers' great work on GNU Octave.
I'm not a software developer, just an ordinary user; no need to add me to the list of Contributors, just remain anonymous :)

Anonymous
Fri 02 Sep 2016 04:50:36 PM UTC, comment #1: 

The development code base had changed a bit more from the 4.0.3 code.  I had to modify which.m and help.m.  In addition, the documentation for any operator with a '\' character was incorrect because it was not escaped either.  I fixed that as well.  See the changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/18b863e3b1e2).

Also, I notice that you have submitted several patches along with bug reports.  If you would like to be credited for your work I can add you to the list of Contributors that appears at the front of the Octave manual.  Also, I can start checking in patches under your name if you like.  We generally use the form


First_Name Last_Name <email@address>


But it is up to you.  Some people prefer to remain anonymous.

Rik <rik5>
Group administrator
Fri 02 Sep 2016 04:23:38 AM UTC, original submission:  


>>  help('"')
error: value on right hand side of assignment is undefined
error: called from
    which at line 36 column 24
    help at line 120 column 7
>>  help('.\')
error: value on right hand side of assignment is undefined
error: called from
    which at line 36 column 24
    help at line 120 column 7
>>  help('\')
error: value on right hand side of assignment is undefined
error: called from
    which at line 36 column 24
    help at line 120 column 7


This is because some characters when put in double quote (") should be backslash escaped.
Possible solution:

--- /usr/share/octave/4.0.3/m/help/which.m
+++ which.m
@@ -34,7 +34,7 @@
     ## functions in name resolution.
     for i = 1:nargin
       m(i).is_variable = evalin ("caller",
-                                 ["exist (\"" m(i).name "\", \"var\")"], false);
+                                 ["exist (\"" undo_string_escapes(m(i).name) "\", \"var\")"], false);
       if (m(i).is_variable)
         m(i).file = "variable";
       endif


Then the result is correct:

>>  help('"')

 -- Operator: "
     String delimiter.

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.
>>  help('.\')

 -- Operator: .\
     Element by element left division operator.

     See also: , ./, rdivide, mrdivide.

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.
>>  help('\')

 -- Operator: \
     Left division operator.

     See also: ., /, ldivide, mldivide.

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.


Other operators are OK.  I use this command to test.

for a=__operators__().' help(a{1}); end


Anonymous

 

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

Attach Files:
   
   
Comment:
   

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 rik5 (Posted a comment)
  • -email is unavailable- added by None (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-02 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code