[mapserver-commits] r7766 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Jun 30 17:25:33 EDT 2008


Author: sdlime
Date: 2008-06-30 17:25:33 -0400 (Mon, 30 Jun 2008)
New Revision: 7766

Modified:
   trunk/mapserver/maptemplate.c
Log:
Fixed a problem with RFC 36 implementation that was causing the [resultset][/resultset] tag processor to read ahead one too many lines.

Modified: trunk/mapserver/maptemplate.c
===================================================================
--- trunk/mapserver/maptemplate.c	2008-06-30 18:01:38 UTC (rev 7765)
+++ trunk/mapserver/maptemplate.c	2008-06-30 21:25:33 UTC (rev 7766)
@@ -974,10 +974,13 @@
 
   if(strstr(*line, "[/resultset]") == NULL) { /* read ahead */
     foundTagEnd = MS_FALSE;
-    while((fgets(lineBuffer, MS_BUFFER_LENGTH, stream) != NULL) && !foundTagEnd) {
-      *line = msStringConcatenate(*line, lineBuffer);
-      if(strstr(*line, "[/resultset]") != NULL)
-        foundTagEnd = MS_TRUE;
+    while(!foundTagEnd) {
+      if(fgets(lineBuffer, MS_BUFFER_LENGTH, stream) != NULL) {
+        *line = msStringConcatenate(*line, lineBuffer);
+        if(strstr(*line, "[/resultset]") != NULL)
+          foundTagEnd = MS_TRUE;
+      } else 
+        break; /* ran out of file */
     }
     if(foundTagEnd == MS_FALSE) {
       msSetError(MS_WEBERR, "[resultset] tag found without closing [/resultset].", "processResultSetTag()");



More information about the mapserver-commits mailing list