[mapserver-commits] r9934 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Mar 11 08:28:13 EST 2010


Author: aboudreault
Date: 2010-03-11 08:28:11 -0500 (Thu, 11 Mar 2010)
New Revision: 9934

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/maphash.c
Log:
Fixed msRemoveHashTable() to return the proper value on failure/success.

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-03-10 22:48:39 UTC (rev 9933)
+++ trunk/mapserver/HISTORY.TXT	2010-03-11 13:28:11 UTC (rev 9934)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Fixed msRemoveHashTable() to return the proper value on failure/success.
+
 - Correct one pass query problems and OGC filter query (#3305)
 
 - Fixed msMSSQL2008CloseConnection() to free the statement handle properly (#3244)

Modified: trunk/mapserver/maphash.c
===================================================================
--- trunk/mapserver/maphash.c	2010-03-10 22:48:39 UTC (rev 9933)
+++ trunk/mapserver/maphash.c	2010-03-11 13:28:11 UTC (rev 9934)
@@ -175,7 +175,7 @@
 { 
     struct hashObj *tp;
     struct hashObj *prev_tp=NULL;
-    int success = 0;
+    int status = MS_FAILURE;
 
     if (!table || !key) {
         msSetError(MS_HASHERR, "No hash table", "msRemoveHashTable");
@@ -191,6 +191,7 @@
     prev_tp = NULL;
     while (tp != NULL) {
         if (strcasecmp(key, tp->key) == 0) {
+            status = MS_SUCCESS;
             if (prev_tp) {     
                 prev_tp->next = tp->next;
                 free(tp);
@@ -201,18 +202,15 @@
                 free(tp);
                 break;
             }
-            success =1;
         }
         prev_tp = tp;
         tp = tp->next;
     }
 
-    if (success) {
+    if (status == MS_SUCCESS)
         table->numitems--;
-        return MS_SUCCESS;
-    }
 
-    return MS_FAILURE;
+    return status;
 }
       
 const char *msFirstKeyFromHashTable( hashTableObj *table )



More information about the mapserver-commits mailing list