Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make string truth do what various code wants.
  • Loading branch information
jnthn committed Feb 24, 2013
1 parent c2321ad commit 6f81315
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1637,10 +1637,10 @@ public static long isfalse(SixModelObject obj, ThreadContext tc) {
return istrue(obj, tc) == 0 ? 1 : 0;
}
public static long istrue_s(String str) {
return str.equals("") || str.equals("0") ? 0 : 1;
return str == null || str.equals("") || str.equals("0") ? 0 : 1;
}
public static long isfalse_s(String str) {
return str.equals("") || str.equals("0") ? 1 : 0;
return str == null || str.equals("") || str.equals("0") ? 1 : 0;
}
public static long not_i(long v) {
return v == 0 ? 1 : 0;
Expand Down

0 comments on commit 6f81315

Please sign in to comment.