From 6330384ba48be118a7eeef4ce4ae47e044c57d70 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Fri, 30 May 2025 02:27:23 +0100 Subject: [PATCH] Fix #8726 --- src/grdconvert.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/grdconvert.c b/src/grdconvert.c index 610c7eb620c..ee53f7caf1c 100644 --- a/src/grdconvert.c +++ b/src/grdconvert.c @@ -29,7 +29,7 @@ #define THIS_MODULE_MODERN_NAME "grdconvert" #define THIS_MODULE_LIB "core" #define THIS_MODULE_PURPOSE "Convert between different grid formats" -#define THIS_MODULE_KEYS "G}" +#define THIS_MODULE_KEYS "': /* Output file may be set this way from the external API */ - n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active); - n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file)); - n_in++; + if (!Ctrl->G.active) { /* No output grid yet. This should be used when returning the output grid to Julia/Matlab */ + n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active); + n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file)); + n_in++; + } break; /* Processes program-specific parameters */