[GRASS-SVN] r66398 - in grass/branches/releasebranch_7_0: general/g.proj lib/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 2 10:04:11 PDT 2015


Author: martinl
Date: 2015-10-02 10:04:11 -0700 (Fri, 02 Oct 2015)
New Revision: 66398

Modified:
   grass/branches/releasebranch_7_0/general/g.proj/main.c
   grass/branches/releasebranch_7_0/lib/raster/open.c
Log:
libgis: include <errno.h> explicitly 
g.proj: fix compilation issue when OGR is disabled 
        (merge r66396-7 from trunk)


Modified: grass/branches/releasebranch_7_0/general/g.proj/main.c
===================================================================
--- grass/branches/releasebranch_7_0/general/g.proj/main.c	2015-10-02 14:44:10 UTC (rev 66397)
+++ grass/branches/releasebranch_7_0/general/g.proj/main.c	2015-10-02 17:04:11 UTC (rev 66398)
@@ -7,7 +7,7 @@
  * PURPOSE:      Provides a means of reporting the contents of GRASS
  *               projection information files and creating
  *               new projection information files.
- * COPYRIGHT:    (C) 2003-2014 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2003-2015 by the GRASS Development Team
  *
  *               This program is free software under the GNU General
  *               Public License (>=v2). Read the file COPYING that
@@ -53,6 +53,7 @@
     struct GModule *module;
     
     int formats;
+    const char *epsg = NULL;
 
     G_set_program_name(argv[0]);
     G_no_gisinit();		/* We don't call G_gisinit() here because it validates the
@@ -231,6 +232,8 @@
 	exit(EXIT_SUCCESS);
     }
 
+    epsg = inepsg->answer;
+
     /* Input */
     /* We can only have one input source, hence if..else construct */
 
@@ -245,9 +248,9 @@
     else if (inproj4->answer)
 	/* Input in PROJ.4 format */
 	input_proj4(inproj4->answer);
-    else if (inepsg->answer)
+    else if (epsg)
 	/* Input from EPSG code */
-	input_epsg(atoi(inepsg->answer));
+	input_epsg(atoi(epsg));
     else
 	/* Input from georeferenced file */
 	input_georef(ingeo->answer);
@@ -299,7 +302,7 @@
 	print_wkt(esristyle->answer, dontprettify->answer);
 #endif
     else if (location->answer)
-	create_location(location->answer, inepsg->answer);
+	create_location(location->answer, epsg);
     else if (create->answer)
 	modify_projinfo();
     else
@@ -314,12 +317,12 @@
 #endif
 
 #ifdef HAVE_OGR
-    if (create->answer && inepsg->answer) {
+    if (create->answer && epsg) {
 #else
     if (create->answer){ 
 #endif
 	/* preserve epsg code for user records only (not used by grass's pj routines) */
-        create_epsg(location->answer, inepsg->answer);
+        create_epsg(location->answer, epsg);
     }
 
 

Modified: grass/branches/releasebranch_7_0/lib/raster/open.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster/open.c	2015-10-02 14:44:10 UTC (rev 66397)
+++ grass/branches/releasebranch_7_0/lib/raster/open.c	2015-10-02 17:04:11 UTC (rev 66398)
@@ -19,6 +19,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <errno.h>
 
 #include <grass/config.h>
 #include <grass/gis.h>



More information about the grass-commit mailing list