Browse files

fix issue 38, boolification of Str

  • Loading branch information...
1 parent 4ef84b6 commit c7b8bcffcbb8b08942dab3a25fc10cbf59ed39e9 @moritz moritz committed Feb 19, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Kernel.cs
View
3 lib/Kernel.cs
@@ -919,7 +919,8 @@ class CtxNum2Bool : ContextHandler<bool> {
class CtxStrBool : ContextHandler<bool> {
public override bool Get(Variable obj) {
- return Kernel.UnboxAny<string>(obj.Fetch()) != "";
+ string s = Kernel.UnboxAny<string>(obj.Fetch());
+ return !(s == "" || s == "0");
}
}

0 comments on commit c7b8bcf

Please sign in to comment.