bugGNU Octave - Bugs: bug #34128, str2num does not return empty...

 
 

bug #34128: str2num does not return empty correctly, but errors out

Submitted by:  Ben Barrowes <barrowes>
Submitted on:  Thu 25 Aug 2011 12:25:16 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Works For MeAssigned to: None
Originator Name: barrowesOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 18 Sep 2011 10:46:14 PM UTC, comment #2:

As this is working in the current sources, I'm closing this report.

It can be reopened if needed.

Ben Abbott <bpabbott>
Project Member
Thu 01 Sep 2011 04:09:46 PM UTC, comment #1:

I'm running the stable branch (3.4.x series) just compiled using the developers sources.

It appears this has been fixed by the changeset below.

http://hg.savannah.gnu.org/hgweb/octave/rev/0c74237b3479

Ben Abbott <bpabbott>
Project Member
Thu 25 Aug 2011 12:25:16 PM UTC, original submission:

str2num does not return an empty matrix properly when receiving non-numeric input.

octave:5> str2num('1+2*a')
stopped in /usr/local/share/octave/3.5.0+/m/strings/str2num.m
debug> dbstack
stopped in:

--> str2num at line 58 [/usr/local/share/octave/3.5.0+/m/strings/str2num.m]
debug>

octave:5>

I have set debug_on_error(1), but I don't think that is the problem because the eval example works fine:

octave:4> eval ('error ("This is a bad example");',

> 'printf ("This error occurred:\n%s\n", lasterr ());');

This error occurred:
This is a bad example
octave:5>

Ben Barrowes <barrowes>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by barrowes (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 18 Sep 2011 10:46:14 PM UTCbpabbottOpen/ClosedOpen=>Closed
    Thu 01 Sep 2011 04:09:46 PM UTCbpabbottStatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1