Subject: patch to fix move crash on mklinux.

From: Mikey <tadpol@lilypad>
Date: Wed, 23 Sep 1998 16:26:14 -0500 (CDT)

Ok, The 2.0.47 build of fvwm was always coring out whenever I tried to move
windows.  As far as I can tell, the reason was from an empty action string
getting passed into GetPositionArguments in misc.c, so I just added a quick
bail-out check and it seems to work now.  I'm not sure if this is the best
solution, but it works. (for whatever its worth, I'm on a PowerMac running
MkLinux DR3)

Here's the patch:
Index: misc.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/misc.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 misc.c
--- misc.c      1998/07/20 17:44:11     1.1.1.1
+++ misc.c      1998/09/23 21:15:27
@@ -470,6 +470,9 @@
   int scrWidth = Scr.MyDisplayWidth;
   int scrHeight = Scr.MyDisplayHeight;
 
+  if( strlen(action) <= 0 )
+    return 0;
+  
   s1 = strtok(action," \t\n");
   s2 = strtok(NULL," \t\n");
   /* DEBUG_FPRINTF((stderr,"GPA: 1=\"%s\", 2=\"%s\"\n",s1,s2)); */

-- 
Mike Tilstra                                   Tadpol
[email-masked]  http://www.tc.umn.edu/~tils0007/
   Sanity is the playground for the unimaginative.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Thu, 24 Sep 1998 12:56:49 -0400

> solution, but it works. (for whatever its worth, I'm on a PowerMac running

Note  that is code  then goes  on  to detect the   NULL input string a
little too late.  The next thing in the code is:

  if (s1 == NULL || s2 == NULL)
    return 0;

A little cleaner is:

char *s1, *s2;

s1 = strtok(action," \t\n");
if (s1 != NULL) {
  s2 = strtok(NULL," \t\n");
  if (s2 != NULL) { 
    if (GetOnePositionArgument(s1,x,w,pFinalX,(float)scrWidth/100,scrWidth)
    && GetOnePositionArgument(s2,y,h,pFinalY,(float)scrHeight/100,scrHeight)) {
      return 2;
    }
  }
}
return 0;

--
Dan Espen                                Phone: (732) 699-5570
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].