Bug 115560

Summary: tointeger("blah") returns 0
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Jiří Suchomel <jsuchome>
Component: YaST2Assignee: Klaus Kämpf <kkaempf>
Status: RESOLVED FIXED QA Contact: Klaus Kämpf <kkaempf>
Severity: Major    
Priority: P5 - None    
Version: Beta 4   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

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.