Skip to content

Commit

Permalink
fix issue 38, boolification of Str
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Feb 19, 2011
1 parent 4ef84b6 commit c7b8bcf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Kernel.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -919,7 +919,8 @@ public override bool Get(Variable obj) {


class CtxStrBool : ContextHandler<bool> { class CtxStrBool : ContextHandler<bool> {
public override bool Get(Variable obj) { public override bool Get(Variable obj) {
return Kernel.UnboxAny<string>(obj.Fetch()) != ""; string s = Kernel.UnboxAny<string>(obj.Fetch());
return !(s == "" || s == "0");
} }
} }


Expand Down

0 comments on commit c7b8bcf

Please sign in to comment.