aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-29 20:40:54 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-29 20:40:54 +0200
commit37230770db02ed3605277dbcf2513f7b9681b635 (patch)
tree81b5cbf29921c450a1e67474a6d4c02c54ba32e7 /uzbl.c
parenta147fd153338f3a25dc726a7448ca10941d867c6 (diff)
patch from anydot, somewhat edited to apply on newer code. original @ http://pastebin.ca/1406151
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c10
1 files changed, 6 insertions, 4 deletions
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);
}
}
}