gnucash maint: Fix Windows build.
John Ralls
jralls at code.gnucash.org
Sat Aug 22 15:59:26 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/c210ceb3 (commit)
from https://github.com/Gnucash/gnucash/commit/98c8b233 (commit)
commit c210ceb3cbfa422effe2a33f8b87d8f6887943ca
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Aug 22 12:59:14 2020 -0700
Fix Windows build.
MinGW doesn't implement strsep, use strtok instead.
diff --git a/gnucash/gnome/business-urls.c b/gnucash/gnome/business-urls.c
index e0283a4f3..3e585267f 100644
--- a/gnucash/gnome/business-urls.c
+++ b/gnucash/gnome/business-urls.c
@@ -186,21 +186,21 @@ jobCB (const char *location, const char *label,
static GHashTable *parse_parameters (const gchar *parms)
{
GHashTable *rethash;
- gchar *query, *p, *orig_query;
+ char *query = strdup (parms);
+ const char *key_tok = "&\n";
+ const char val_tok = '=';
rethash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
- query = g_strdup (parms);
- orig_query = query;
- while ((p = strsep (&query, "&\n")))
+ for (char *p = strtok (query, key_tok); p; p = strtok (NULL, key_tok))
{
- gchar * val = strchr (p, '=');
+ gchar * val = strchr (p, val_tok);
*(val++) = '\0';
if (val && !g_hash_table_contains (rethash, p))
g_hash_table_insert (rethash, g_strdup (p), g_strdup (val));
}
- g_free (orig_query);
+ g_free (query);
return rethash;
}
Summary of changes:
gnucash/gnome/business-urls.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
More information about the gnucash-changes
mailing list