ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] new fdump structure may affect scripts


From: jesus c. meyendriesch
Subject: Re: [RP] new fdump structure may affect scripts
Date: Thu Dec 2 13:06:05 2004
User-agent: Mutt/1.5.6+20040907i

Hello again..

there is a problem in the frestore function. The cause seems to be
strtok. strtok_r is probably better. Therefore is here a small patch for
it:

Index: actions.c
===================================================================
RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v
retrieving revision 1.216
diff -u -r1.216 actions.c
--- actions.c   2 Dec 2004 00:22:39 -0000       1.216
+++ actions.c   2 Dec 2004 20:34:40 -0000
@@ -3771,6 +3771,7 @@
   rp_window *win;
   struct list_head fset;
   int max = -1;
+  char *nexttok;
 
   if (data == NULL)
     {
@@ -3781,7 +3782,7 @@
   INIT_LIST_HEAD (&fset);
 
   dup = xstrdup (data);
-  token = strtok (dup, ",");
+  token = strtok_r (dup, ",", &nexttok);
   if (token == NULL)
     {
       message (" frestore: invalid frame format ");
@@ -3800,7 +3801,7 @@
          return NULL;
        }
       list_add_tail (&new->node, &fset);
-      token = strtok (NULL, ",");
+      token = strtok_r (NULL, ",", &nexttok);
     } 
 
   free (dup);


greeting
 jesus..



reply via email to

[Prev in Thread] Current Thread [Next in Thread]