[GRASS-SVN] r50633 - grass/branches/develbranch_6/lib/db/dbmi_base

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 2 07:27:44 EST 2012


Author: martinl
Date: 2012-02-02 04:27:44 -0800 (Thu, 02 Feb 2012)
New Revision: 50633

Modified:
   grass/branches/develbranch_6/lib/db/dbmi_base/dbmscap.c
Log:
dbmi_base: skip manifest files when listing drivers - check permission X_OK
	   (merge r50632 from trunk)


Modified: grass/branches/develbranch_6/lib/db/dbmi_base/dbmscap.c
===================================================================
--- grass/branches/develbranch_6/lib/db/dbmi_base/dbmscap.c	2012-02-02 12:26:35 UTC (rev 50632)
+++ grass/branches/develbranch_6/lib/db/dbmi_base/dbmscap.c	2012-02-02 12:27:44 UTC (rev 50633)
@@ -165,19 +165,17 @@
     while ((ent = readdir(dir))) {
 	char *name;
 
-	if ((strcmp(ent->d_name, ".") == 0)
-	    || (strcmp(ent->d_name, "..") == 0))
+	if ((strcmp(ent->d_name, ".") == 0) ||
+	    (strcmp(ent->d_name, "..") == 0))
 	    continue;
 
 #ifdef __MINGW32__
-	/* skip manifest files on Windows */
-	if (G_strstr(ent->d_name, ".manifest"))
-	    continue;
+	/* remove '.exe' from name (windows extension) */
+	name = G_str_replace(ent->d_name, ".exe", "");
+#else
+	name = G_store(ent->d_name);
 #endif
 
-	/* Remove '.exe' from name (windows extension) */
-	name = G_str_replace(ent->d_name, ".exe", "");
-
 #ifdef __MINGW32__
 	dirpath = G_malloc(strlen("\\driver\\db\\")
 			   + strlen(G_gisbase()) + strlen(ent->d_name) + 1);
@@ -186,6 +184,9 @@
 #else
 	G_asprintf(&dirpath, "%s/driver/db/%s", G_gisbase(), ent->d_name);
 #endif
+	if (access(dirpath, X_OK) != 0)
+	    continue;
+	
 	add_entry(&list, name, dirpath, "");
 	G_free(name);
 	G_free(dirpath);



More information about the grass-commit mailing list