From 37230770db02ed3605277dbcf2513f7b9681b635 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 29 Apr 2009 20:40:54 +0200 Subject: patch from anydot, somewhat edited to apply on newer code. original @ http://pastebin.ca/1406151 --- uzbl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'uzbl.c') diff --git a/uzbl.c b/uzbl.c index 074d27a..401e628 100644 --- a/uzbl.c +++ b/uzbl.c @@ -326,8 +326,9 @@ parse_command(const char *cmd) { Command *c = NULL; char buffer[512]; strcpy (buffer, cmd); - char * command_name = strtok (buffer, " "); - gchar * command_param = strtok (NULL, " ,"); + char * saveptr; + char * command_name = strtok_r (buffer, " ", &saveptr); + gchar * command_param = strtok_r (NULL, " ,", &saveptr); if((c = g_hash_table_lookup(commands, command_name)) != NULL){ if (c->func_2_params != NULL) { @@ -508,6 +509,7 @@ settings_init () { gboolean res = FALSE; gchar** keysi = NULL; gchar** keyse = NULL; + char *saveptr; if (! config_file) { const char* XDG_CONFIG_HOME = getenv ("XDG_CONFIG_HOME"); @@ -532,7 +534,7 @@ settings_init () { char buffer[512]; strcpy (buffer, XDG_CONFIG_DIRS); - const gchar* dir = strtok (buffer, ":"); + const gchar* dir = (char *) strtok_r (buffer, ":", &saveptr); while (dir && ! file_exists (conf)) { strcpy (conf, dir); strcat (conf, "/uzbl/config"); @@ -540,7 +542,7 @@ settings_init () { printf ("Config file %s found.\n", conf); config_file = &conf[0]; } - dir = strtok (NULL, ":"); + dir = (char * ) strtok_r (NULL, ":", &saveptr); } } } -- cgit v1.2.3