Index: src/frame.c =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/frame.c,v retrieving revision 1.14 diff -u -r1.14 frame.c --- src/frame.c 15 Jan 2005 19:21:16 -0000 1.14 +++ src/frame.c 17 Jan 2005 09:44:00 -0000 @@ -188,7 +188,7 @@ } /* Used only by frame_read */ -#define read_slot(x) do { tmp = strtok (NULL, " "); x = strtol(tmp,NULL,10); } while(0) +#define read_slot(x) do { tmp = strtok_r (NULL, " ", &nexttok); x = strtol(tmp,NULL,10); } while(0) rp_frame * frame_read (char *str) @@ -197,6 +197,7 @@ rp_window *win; rp_frame *f; char *tmp, *dup; + char *nexttok; /* Create a blank frame. */ f = xmalloc (sizeof (rp_frame)); @@ -205,10 +206,10 @@ PRINT_DEBUG(("parsing '%s'\n", str)); dup = xstrdup(str); - tmp = strtok (dup, " "); + tmp = strtok_r(dup, " ", &nexttok); /* Verify it starts with '(frame ' */ - if (strcmp(tmp, "(frame ")) + if (strcmp(tmp, "(frame ") == 0) { PRINT_DEBUG(("Doesn't start with '(frame '\n")); free (dup); @@ -216,7 +217,7 @@ return NULL; } /* NOTE: there is no check to make sure each field was filled in. */ - tmp = strtok(NULL, " "); + tmp = strtok_r(NULL, " ", &nexttok); while (tmp) { if (!strcmp(tmp, ":number")) @@ -240,7 +241,7 @@ else PRINT_ERROR(("Unknown slot %s\n", tmp)); /* Read the next token. */ - tmp = strtok(NULL, " "); + tmp = strtok_r(NULL, " ", &nexttok); } if (tmp) PRINT_ERROR(("Frame has trailing garbage\n"));