[mapserver-commits] r10200 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Jun 1 12:49:34 EDT 2010


Author: sdlime
Date: 2010-06-01 12:49:34 -0400 (Tue, 01 Jun 2010)
New Revision: 10200

Modified:
   trunk/mapserver/maptemplate.c
Log:
Only throw an error for an invalid stream (in processResultTag()) if we actually have to read-ahead in the file because we didn't find a closing tag.

Modified: trunk/mapserver/maptemplate.c
===================================================================
--- trunk/mapserver/maptemplate.c	2010-06-01 16:46:05 UTC (rev 10199)
+++ trunk/mapserver/maptemplate.c	2010-06-01 16:49:34 UTC (rev 10200)
@@ -949,11 +949,6 @@
   tagStart = findTag(*line, "resultset");
   if(!tagStart) return(MS_SUCCESS); /* OK, just return; */
 
-  if(!stream) {
-    msSetError(MS_WEBERR, "Invalid file pointer.", "processResultSetTag()");
-    return(MS_FAILURE);
-  }
-
   while (tagStart) {  
     /* initialize the tag arguments */
     layerName = NULL;
@@ -978,6 +973,11 @@
     lp = GET_LAYER(mapserv->map, layerIndex);
 
     if(strstr(*line, "[/resultset]") == NULL) { /* read ahead */
+      if(!stream) {
+        msSetError(MS_WEBERR, "Invalid file pointer.", "processResultSetTag()");
+        return(MS_FAILURE);
+      }
+
       foundTagEnd = MS_FALSE;
       while(!foundTagEnd) {
         if(fgets(lineBuffer, MS_BUFFER_LENGTH, stream) != NULL) {



More information about the mapserver-commits mailing list