comparison src/c/urweb.c @ 296:5dc11235129d

Reading bools from SQL
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 12:58:33 -0400
parents 1afa94582275
children 9ad92047a499
comparison
equal deleted inserted replaced
295:1afa94582275 296:5dc11235129d
806 else 806 else
807 lw_error(ctx, FATAL, "Can't parse float: %s", s); 807 lw_error(ctx, FATAL, "Can't parse float: %s", s);
808 } 808 }
809 809
810 lw_Basis_bool lw_Basis_stringToBool_error(lw_context ctx, lw_Basis_string s) { 810 lw_Basis_bool lw_Basis_stringToBool_error(lw_context ctx, lw_Basis_string s) {
811 if (!strcasecmp (s, "True")) 811 if (!strcasecmp(s, "T") || !strcasecmp (s, "True"))
812 return lw_Basis_True; 812 return lw_Basis_True;
813 else if (!strcasecmp (s, "False")) 813 else if (!strcasecmp(s, "F") || !strcasecmp (s, "False"))
814 return lw_Basis_False; 814 return lw_Basis_False;
815 else 815 else
816 lw_error(ctx, FATAL, "Can't parse bool: %s", s); 816 lw_error(ctx, FATAL, "Can't parse bool: %s", s);
817 } 817 }