$OpenBSD: patch-sope-gdl1_MySQL_NSNumber+MySQL4Val_m,v 1.1 2011/11/18 11:12:44 sebastia Exp $

fix bug when completing tasks with mysql backend, taken from
http://mtn.inverse.ca/revision/diff/6eaf4a45ce4e94507a541be4594b94f2adc500a6/with/251b4565fb618249a9be38b2f6e86da9f39d8945

--- sope-gdl1/MySQL/NSNumber+MySQL4Val.m.orig	Tue Nov  2 15:12:14 2010
+++ sope-gdl1/MySQL/NSNumber+MySQL4Val.m	Sun Nov 13 21:26:22 2011
@@ -77,7 +77,22 @@
   if ((len = [_type length]) == 0)
     return [self stringValue];
   if (len < 4)
-    return [self stringValue];
+    {
+#if GNUSTEP_BASE_LIBRARY
+    /*
+       on gstep-base -stringValue of bool's return YES or NO, which seems to
+       be different on Cocoa and liBFoundation.
+    */
+    {
+      Class BoolClass = Nil;
+      
+      if (BoolClass == Nil) BoolClass = NSClassFromString(@"NSBoolNumber");
+      if ([self isKindOfClass:BoolClass])
+	return [self boolValue] ? @"1" : @"0";
+    }
+#endif
+      return [self stringValue];
+    }
 
   c1 = [_type characterAtIndex:0];
   switch (c1) {
