[GRASS-SVN] r66940 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Nov 27 11:34:05 PST 2015
Author: martinl
Date: 2015-11-27 11:34:05 -0800 (Fri, 27 Nov 2015)
New Revision: 66940
Modified:
grass/trunk/lib/gis/parser.c
Log:
libgis: don't ignore global options in G_recreate_command()
Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c 2015-11-27 09:47:53 UTC (rev 66939)
+++ grass/trunk/lib/gis/parser.c 2015-11-27 19:34:05 UTC (rev 66940)
@@ -330,6 +330,7 @@
st->pgm_path = tmp_name;
st->n_errors = 0;
st->error = NULL;
+ st->module_info.verbose = G_verbose_std();
i = strlen(tmp_name);
while (--i >= 0) {
if (G_is_dirsep(tmp_name[i])) {
@@ -645,6 +646,34 @@
strcpy(cur, tmp);
cur += len;
+ if (st->overwrite) {
+ slen = strlen(" --overwrite");
+ if (len + slen >= nalloced) {
+ nalloced += (1024 > len) ? 1024 : len + 1;
+ buff = G_realloc(buff, nalloced);
+ }
+ strcpy(cur, " --overwrite");
+ cur += slen;
+ len += slen;
+ }
+
+ if (st->module_info.verbose != G_verbose_std()) {
+ char *sflg;
+ if (st->module_info.verbose == G_verbose_max())
+ sflg = " --verbose";
+ else
+ sflg = " --quiet";
+
+ slen = strlen(sflg);
+ if (len + slen >= nalloced) {
+ nalloced += (1024 > len) ? 1024 : len + 1;
+ buff = G_realloc(buff, nalloced);
+ }
+ strcpy(cur, sflg);
+ cur += slen;
+ len += slen;
+ }
+
if (st->n_flags) {
flag = &st->first_flag;
while (flag) {
More information about the grass-commit
mailing list