[GRASS-SVN] r51198 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Mar 30 08:57:27 EDT 2012
Author: martinl
Date: 2012-03-30 05:57:26 -0700 (Fri, 30 Mar 2012)
New Revision: 51198
Modified:
grass/trunk/lib/vector/Vlib/header.c
Log:
vlib: simplify Vect_get_finfo_format_info()
Modified: grass/trunk/lib/vector/Vlib/header.c
===================================================================
--- grass/trunk/lib/vector/Vlib/header.c 2012-03-30 12:56:37 UTC (rev 51197)
+++ grass/trunk/lib/vector/Vlib/header.c 2012-03-30 12:57:26 UTC (rev 51198)
@@ -328,20 +328,16 @@
/*!
\brief Get format info (relevant only for non-native formats)
- Allocated space should be freed by G_free().
-
Returns:
- layer name for OGR format (GV_FORMAT_OGR and GV_FORMAT_OGR_DIRECT)
\param Map pointer to Map_info structure
\return string containing name of OGR format (allocated by G_store())
- \return NULL on error (or on missing OGR support)
+ \return NULL on error (or on missing OGR/PostgreSQL support)
*/
const char *Vect_get_finfo_format_info(const struct Map_info *Map)
{
- char format[GPATH_MAX];
-
if (Map->format == GV_FORMAT_OGR ||
Map->format == GV_FORMAT_OGR_DIRECT) {
#ifndef HAVE_OGR
@@ -350,16 +346,14 @@
if (!Map->fInfo.ogr.ds)
return NULL;
- sprintf(format, "%s/%s", "OGR",
- OGR_Dr_GetName(OGR_DS_GetDriver(Map->fInfo.ogr.ds)));
- return G_store(format);
+ return OGR_Dr_GetName(OGR_DS_GetDriver(Map->fInfo.ogr.ds));
#endif
}
else if (Map->format == GV_FORMAT_POSTGIS) {
#ifndef HAVE_OGR
G_warning(_("GRASS is not compiled with PostgreSQL support"));
#else
- return G_store("PostGIS");
+ return "PostgreSQL";
#endif
}
More information about the grass-commit
mailing list