Artifacts Associated With Ticket 1962090
Ticket change [176c28821b] (rid 122491) by nobody on 2008-05-11 22:46:30:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I was trying to do some data validation, and ran across the following situation, which the example below demonstrates. % info patchlevel 8.4.17 % set s "5\n" 5 % string is double -strict $s 1 % expr {$s >= 0.0} 1 The string 's' is clearly not a double since it contains a control character, however the string test for double is returning true, which it should fail. The expr command is even more puzzling since the string is not a number, but the comparison returns true. IMHO both of these tests should return zero as the string is clearly not a double. - foundin initialized to: "obsolete: 8.4.17"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "11. Conversions from String"
- title initialized to: "Failure of string and expr commands"
- type initialized to: "Bug"
Ticket change [5da35c942f] (rid 115507) by hobbs on 2008-05-12 05:53:04:
- closedate changed to: "2008-05-11T22:53:04"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 Originator: NO To be clear, this control char is actually in the subspace of whitespace characters, which have more lenient handling at the C level. It is no different than " 5 ", which is 5 as a number to strtod. BTW, the comparison <= is dangerous because it can do string comparisons, but you will see that it is a valid "integer" by doing + 1 as well.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "hobbs"