[mapserver-commits] r8169 - branches/branch-5-2/mapserver

svn at osgeo.org svn at osgeo.org
Tue Dec 2 12:14:40 EST 2008


Author: tomkralidis
Date: 2008-12-02 12:14:39 -0500 (Tue, 02 Dec 2008)
New Revision: 8169

Modified:
   branches/branch-5-2/mapserver/HISTORY.TXT
   branches/branch-5-2/mapserver/mapowscommon.c
Log:
output version string correctly (#2821)


Modified: branches/branch-5-2/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-2/mapserver/HISTORY.TXT	2008-12-02 17:14:05 UTC (rev 8168)
+++ branches/branch-5-2/mapserver/HISTORY.TXT	2008-12-02 17:14:39 UTC (rev 8169)
@@ -13,6 +13,8 @@
 Current Version (SVN branch-5-2)
 --------------------------------
 
+- mapowscommon.c: output version string correctly (#2821)
+
 Version 5.2.1 (2008-12-01):
 ---------------------------
 

Modified: branches/branch-5-2/mapserver/mapowscommon.c
===================================================================
--- branches/branch-5-2/mapserver/mapowscommon.c	2008-12-02 17:14:05 UTC (rev 8168)
+++ branches/branch-5-2/mapserver/mapowscommon.c	2008-12-02 17:14:39 UTC (rev 8169)
@@ -479,7 +479,7 @@
 
 xmlNodePtr msOWSCommonExceptionReport(xmlNsPtr psNsOws, int ows_version, const char *schemas_location, const char *version, const char *language, const char *exceptionCode, const char *locator, const char *ExceptionText) {
   char *xsi_schemaLocation = NULL;
-  char *ows_version_string = NULL;
+  char szVersionBuf[OWS_VERSION_MAXLEN];
 
   xmlNsPtr     psNsXsi     = NULL;
   xmlNodePtr   psRootNode  = NULL;
@@ -493,22 +493,18 @@
   /* add attributes to root element */
   xmlNewProp(psRootNode, BAD_CAST "version", BAD_CAST version);
 
-  if (language !=  "undefined") {
-    if (ows_version == OWS_1_0_0) {
-      ows_version_string = strdup("1.0.0");
-      xmlNewProp(psRootNode, BAD_CAST "language", BAD_CAST language);
-    }
-    if (ows_version == OWS_1_1_0) {
-      ows_version_string = strdup("1.1.0");
-      xmlNewProp(psRootNode, BAD_CAST "xml:lang", BAD_CAST language);
-    }
+  if (ows_version == OWS_1_0_0) {
+    xmlNewProp(psRootNode, BAD_CAST "language", BAD_CAST language);
   }
+  if (ows_version == OWS_1_1_0) {
+    xmlNewProp(psRootNode, BAD_CAST "xml:lang", BAD_CAST language);
+  }
 
   xsi_schemaLocation = strdup((char *)psNsOws->href);
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, " ");
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, (char *)schemas_location);
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, "/ows/");
-  xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, (char *)ows_version_string);
+  xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, (char *)msOWSGetVersionString(ows_version, szVersionBuf));
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, "/owsExceptionReport.xsd");
 
   /* add namespace'd attributes to root element */
@@ -528,7 +524,6 @@
     psNode = xmlNewChild(psMainNode, NULL, BAD_CAST "ExceptionText", BAD_CAST ExceptionText);
   }
 
-  free(ows_version_string);
   free(xsi_schemaLocation);
   return psRootNode;
 }



More information about the mapserver-commits mailing list