From 48c3fbe8822a0cb22f192de95fc2e2ef2f21dab8 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Tue, 26 May 2026 23:32:19 +0100 Subject: [PATCH] psbasemap: iisue with pen style in MAP_GRID_PEN Fix #8647 Assisted-by: Claude Opus 4.7 --- src/gmt_support.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gmt_support.c b/src/gmt_support.c index 4a0e2bf259c..6b176cf54e3 100644 --- a/src/gmt_support.c +++ b/src/gmt_support.c @@ -7515,7 +7515,9 @@ bool gmt_getpen (struct GMT_CTRL *GMT, char *buffer, struct GMT_PEN *P) { for (i = 0; line[i]; i++) if (line[i] == ',') line[i] = ' '; /* Replace , with space */ n = sscanf (line, "%s %s %s", width, color, style); for (i = 0; line[i]; i++) if (line[i] == ' ') line[i] = ','; /* Replace space with , */ - if (n == 2) { /* Could be width,color or width,style or color,style */ + if (n == 3) /* width,color,style all given; user-supplied width wins */ + set_NaN = false; + else if (n == 2) { /* Could be width,color or width,style or color,style */ if (line[0] == ',') { /* ,color,style got stored in width,color */ strncpy (style, color, GMT_LEN256-1); strncpy (color, width, GMT_LEN256-1);