[mapserver-commits] r10592 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Oct 12 10:42:29 EDT 2010


Author: warmerdam
Date: 2010-10-12 07:42:29 -0700 (Tue, 12 Oct 2010)
New Revision: 10592

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/sortshp.c
Log:
improve error checking and reporting (#3564)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-10-11 17:32:38 UTC (rev 10591)
+++ trunk/mapserver/HISTORY.TXT	2010-10-12 14:42:29 UTC (rev 10592)
@@ -14,6 +14,11 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- mapshape.c: Fix writing of geometries with z/m and fail gracefully attempting
+  to create such files if USE_POINT_Z_M is not enabled (#3564)
+
+- sortshp.c: improve error handling (#3564)
+
 - MSSQL2008: Add support for geography data type by extending the DATA syntax 
   to 'geometry_column(geometry_type) from table_name'
 

Modified: trunk/mapserver/sortshp.c
===================================================================
--- trunk/mapserver/sortshp.c	2010-10-11 17:32:38 UTC (rev 10591)
+++ trunk/mapserver/sortshp.c	2010-10-12 14:42:29 UTC (rev 10592)
@@ -104,6 +104,8 @@
       exit(0);
   }
 
+  msSetErrorFile("stderr");
+
   /* ------------------------------------------------------------------------------- */
   /*       Open the shapefile                                                        */
   /* ------------------------------------------------------------------------------- */
@@ -184,8 +186,19 @@
   /*       Setup the output .shp/.shx and .dbf files                                 */
   /* ------------------------------------------------------------------------------- */
   outSHP = msSHPCreate(argv[2],shpType);
+  if( outSHP == NULL )
+  {
+      fprintf( stderr, "Failed to create file '%s'.\n", argv[2] );
+      exit( 1 );
+  }
+
   sprintf(buffer,"%s.dbf",argv[2]);
   outDBF = msDBFCreate(buffer);
+  if( outDBF == NULL )
+  {
+      fprintf( stderr, "Failed to create dbf file '%s'.\n", buffer );
+      exit( 1 );
+  }
 
   for(i=0;i<num_fields;i++) {
     dbfField = msDBFGetFieldInfo(inDBF,i,fName,&fWidth,&fnDecimals); /* ---- Get field info from in file ---- */



More information about the mapserver-commits mailing list