[GRASS-SVN] r66981 - grass/branches/releasebranch_7_0/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Nov 29 05:50:43 PST 2015
Author: martinl
Date: 2015-11-29 05:50:43 -0800 (Sun, 29 Nov 2015)
New Revision: 66981
Modified:
grass/branches/releasebranch_7_0/lib/gis/parser.c
Log:
libgis: don't ignore global options in G_recreate_command()
(merge r66940 from trunk)
Modified: grass/branches/releasebranch_7_0/lib/gis/parser.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/gis/parser.c 2015-11-29 13:50:12 UTC (rev 66980)
+++ grass/branches/releasebranch_7_0/lib/gis/parser.c 2015-11-29 13:50:43 UTC (rev 66981)
@@ -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