bugGNU Octave - Bugs: bug #56853, [octave forge] (generate_html)...

 
 

bug #56853: [octave forge] (generate_html) Issues with urlview.m

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Tue 03 Sep 2019 09:36:23 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  None Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  Open
Release:  other Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Wed 04 Sep 2019 08:15:41 PM UTC, comment #4: 

Yes, either cmd{1} or cmd{:} would be the appropriate fix.

Mike Miller <mtmiller>
Project Administrator
Tue 03 Sep 2019 07:19:55 PM UTC, comment #3: 

(Hmmm, can't login into Savannah ??)

Thanks for the pointer to bug #56567.

Still this needs to be fixed in the generate_html package, IMO. As Rik stated in that bug report, syntax like "cell_array{}" looks like bad coding practice.
Looking deeper in the actual code, AFAICS it is cmd{1} that is needed so why not supply the index explicitly.

-Philip

Anonymous
Tue 03 Sep 2019 06:31:27 PM UTC, comment #2: 

Here is the change on the development branch: https://hg.savannah.gnu.org/hgweb/octave/rev/3140380861ce. See bug #56167 for full discussion.

Mike Miller <mtmiller>
Project Administrator
Tue 03 Sep 2019 06:28:08 PM UTC, comment #1: 

Yes, this is a new change in Octave 6.0.0, it still works in Octave 5.1:

>> a = {'f'}
a =
{
  [1,1] = f
}

>> a{}
ans = f

Not sure of the specific change. Just noting that this only affects the development version at the moment, and can easily be fixed to be backwards and forwards compatible.

Mike Miller <mtmiller>
Project Administrator
Tue 03 Sep 2019 09:36:23 AM UTC, original submission:  

On L.79-80 of urlview.m there is:

    for cmd = {"firefox", "epiphany"}
      if (! ([err, path] = system (sprintf ("which %s", cmd{}))))

...where Octave chokes on the cmd{} syntax with the message:

error: invalid empty index expression
error: called from
    urlview at line 80 column 7

On L.111-112 there's a similar one: pars{}

I don't know if this has ever worked in Octave, I suppose it might have otherwise this wouldn't have crept in the code.
Anyway in Matlab this gives an error as well:

>> a = {'f'}
a =
    'f'
>> a{}
a{}
   |
Error: Unbalanced or unexpected parenthesis or bracket.

The fix in this case is probably easy, along the lines of:
-      if (! ([err, path] = system (sprintf ("which %s", cmd{}))))
+      if (! ([err, path] = system (sprintf ("which %s", cmd{1}))))

Another issue with urlview is that it won't work on Windows.
The "which" command referenced on L.80 isn't implemented there, nor in the mxe-octave binaries.
Further down Ls. 124-127 don't work either on Windows.

I'd suggest a check at the top of urlview.m along the lines of:

if (ispc)
  error ("urlview doesn't work on Windows systems")
endif

cc'íng Olaf as he is the author of urlview.m

Philip Nienhuis <philipnienhuis>
Project Member

 

(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 philipnienhuis (Submitted the item)
  • -email is unavailable- added by philipnienhuis
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-04 mtmiller Summary[octave-forge] (generate_html) Issues with urlview.m => [octave forge] (generate_html) Issues with urlview.m
    2019-09-03 philipnienhuis Carbon-Copy- => Added i7tiol

    Back to the top


    Powered by Savane 3.5