Bug 115560 - tointeger("blah") returns 0
Summary: tointeger("blah") returns 0
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Beta 4
Hardware: Other All
: P5 - None : Major
Target Milestone: ---
Assignee: Klaus Kämpf
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-07 08:24 UTC by Jiří Suchomel
Modified: 2005-11-24 17:08 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Suchomel 2005-09-07 08:24:07 UTC
tointeger("blah") returns 0 : should it? With this, tointeger cannot be used for
checking if given string is convertible to integer.
Comment 1 Klaus Kämpf 2005-09-07 08:29:11 UTC
Thats clearly a bug. nil should be returned. 
 
Will fix this after 10.0 
Comment 2 Klaus Kämpf 2005-09-07 08:30:07 UTC
later 
Comment 3 Jiří Suchomel 2005-11-24 09:49:59 UTC
Could someone do it?
Comment 4 Klaus Kämpf 2005-11-24 12:42:08 UTC
The fix it not the problem. But how much existing code will break ?
(we probably have to 'grep -r tointeger' across YaST ...)
Comment 5 Jiří Suchomel 2005-11-24 12:45:24 UTC
If this is the correct behaviour, I think it should be changed and we will see what relies on the incorrect one.
Comment 6 Klaus Kämpf 2005-11-24 17:08:06 UTC
Its even documented to return nil on illegal strings.

Fixed in SVN, added testcase.