[GRASS-SVN] r45073 - grass/branches/develbranch_6/general/g.findfile
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 18 04:12:41 EST 2011
Author: martinl
Date: 2011-01-18 01:12:40 -0800 (Tue, 18 Jan 2011)
New Revision: 45073
Modified:
grass/branches/develbranch_6/general/g.findfile/main.c
Log:
revert r45069
Modified: grass/branches/develbranch_6/general/g.findfile/main.c
===================================================================
--- grass/branches/develbranch_6/general/g.findfile/main.c 2011-01-17 20:59:56 UTC (rev 45072)
+++ grass/branches/develbranch_6/general/g.findfile/main.c 2011-01-18 09:12:40 UTC (rev 45073)
@@ -32,7 +32,7 @@
struct Flag *n_flag;
module = G_define_module();
- module->keywords = _("general, data base files");
+ module->keywords = _("general");
module->description =
_("Searches for GRASS data base files "
"and sets variables for the shell.");
@@ -57,8 +57,8 @@
mapset_opt->key = "mapset";
mapset_opt->type = TYPE_STRING;
mapset_opt->required = NO;
- mapset_opt->label = _("Name of a mapset (default: search path)");
- mapset_opt->description = _("'.' for current mapset");
+ mapset_opt->description = _("Name of a mapset");
+ mapset_opt->answer = "";
n_flag = G_define_flag();
n_flag->key = 'n';
@@ -68,9 +68,6 @@
exit(EXIT_FAILURE);
search_mapset = mapset_opt->answer;
- if (!search_mapset) {
- search_mapset = G_store("");
- }
if (strcmp(".", search_mapset) == 0)
search_mapset = G_mapset();
@@ -94,17 +91,13 @@
mapset = G_find_file2(elem_opt->answer, name, search_mapset);
if (mapset) {
- char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
const char *qchar = n_flag->answer ? "" : "'";
const char *qual = G_fully_qualified_name(name, mapset);
- G_unqualified_name(name, mapset, xname, xmapset);
G__file_name(file, elem_opt->answer, name, mapset);
- fprintf(stdout, "name=%s%s%s\n", qchar, xname, qchar);
- fprintf(stdout, "mapset=%s%s%s\n", qchar, xmapset, qchar);
+ fprintf(stdout, "name=%s%s%s\n", qchar, name, qchar);
+ fprintf(stdout, "mapset=%s%s%s\n", qchar, mapset, qchar);
fprintf(stdout, "fullname=%s%s%s\n", qchar, qual, qchar);
fprintf(stdout, "file=%s%s%s\n", qchar, file, qchar);
-
- return EXIT_SUCCESS;
}
else {
fprintf(stdout, "name=\n");
@@ -113,5 +106,5 @@
fprintf(stdout, "file=\n");
}
- return EXIT_FAILURE;
+ exit(mapset == NULL);
}
More information about the grass-commit
mailing list