[mirrorbrain-commits] [opensuse-svn] r6557 - trunk/tools/download-redirector-v2/mod_mirrorbrain

From: Novell Forge SVN <noreply_at_novell.com>
Date: Tue, 24 Feb 2009 09:30:03 -0700 (MST)
Author: poeml
Date: 2009-02-24 09:29:59 -0700 (Tue, 24 Feb 2009)
New Revision: 6557

Modified:
   trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c
Log:
mod_mirrorbrain:
- fix bug that occured with version 2.5 and affects PostgreSQL installs:
  make the region_only,country_only,as_only,prefix_only flags work again
  by recognizing boolean field type in addition to integer type


Modified: trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c
===================================================================
--- trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c	2009-02-24 16:25:39 UTC (rev 6556)
+++ trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c	2009-02-24 16:29:59 UTC (rev 6557)
_at_@ -1177,25 +1177,25 @@
         if ((val = apr_dbd_get_entry(dbd->driver, row, col++)) == NULL) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "[mod_mirrorbrain] apr_dbd_get_entry found NULL for region_only");
         } else
-            new->region_only = (unsigned char)atoi(val);
+            new->region_only = ((val[0] == 't') || (val[0] == '1')) ? 1 : 0;
 
         /* country_only */
         if ((val = apr_dbd_get_entry(dbd->driver, row, col++)) == NULL) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "[mod_mirrorbrain] apr_dbd_get_entry found NULL for country_only");
         } else
-            new->country_only = (unsigned char)atoi(val);
+            new->country_only = ((val[0] == 't') || (val[0] == '1')) ? 1 : 0;
 
         /* as_only */
         if ((val = apr_dbd_get_entry(dbd->driver, row, col++)) == NULL) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "[mod_mirrorbrain] apr_dbd_get_entry found NULL for as_only");
         } else
-            new->as_only = (unsigned char)atoi(val);
+            new->as_only = ((val[0] == 't') || (val[0] == '1')) ? 1 : 0;
 
         /* prefix_only */
         if ((val = apr_dbd_get_entry(dbd->driver, row, col++)) == NULL) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "[mod_mirrorbrain] apr_dbd_get_entry found NULL for prefix_only");
         } else
-            new->prefix_only = (unsigned char)atoi(val);
+            new->prefix_only = ((val[0] == 't') || (val[0] == '1')) ? 1 : 0;
 
         /* other_countries */
         if ((val = apr_dbd_get_entry(dbd->driver, row, col++)) == NULL)

_______________________________________________
Opensuse-svn mailing list
Opensuse-svn_at_forge.novell.com
http://forge.novell.com/mailman/listinfo/opensuse-svn


_______________________________________________
mirrorbrain-commits mailing list

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Feb 24 2009 - 16:30:16 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT