Subject: quoted strings patch with UseDecor and UseStyle

From: Andrew Veliath <[email-masked]>
Date: Tue, 7 Jan 1997 20:09:46 -0500 (EST)

Chuck may have an altogether different solution, but just in case
you'd like to use quoted strings with UseStyle or UseDecor here
is a patch for that.

--
Andrew Veliath <[email-masked]>        http://www.rpi.edu/~veliaa
One day, all forms of communication will be superseded by a FAQ.
Finger for PGP Public Key
Key fingerprint =  51 56 5D 3E 51 43 8B 74  7C B2 E4 B6 84 8E 8B 08

--- ../../orig/fvwm-2.0.44-almost/fvwm/style.c	Mon Dec 23 17:07:48 1996
+++ style.c	Tue Jan  7 19:55:41 1997
@@ -581,17 +581,24 @@
 #ifdef USEDECOR
         if(mystrncasecmp(restofline,"UseDecor",8)==0)
         {
+          int is_quoted = 0;
           restofline += 8;
           while(isspace(*restofline))restofline++;
+          if (*restofline == '"') {
+              is_quoted = 1;
+              ++restofline;
+          }
           tmp = restofline;
           len = 0;
-          while((tmp != NULL)&&(*tmp != 0)&&(*tmp != ',')&&
-                (*tmp != '\n')&&(*tmp != '/')&&(!isspace(*tmp)))
+          while (tmp && *tmp &&
+                 ((!is_quoted&&(*tmp != ',')&&(*tmp != '\n')&&(!isspace(*tmp)))
+                  || (is_quoted&&(*tmp != '\n')&&(*tmp != '"'))))
           {
             tmp++;
             len++;
           }
-          if(len > 0)
+          if (tmp && (*tmp == '"')) ++tmp;
+          if (len > 0)
           {
             decor = safemalloc(len+1);
             strncpy(decor,restofline,len);
@@ -602,13 +609,24 @@
 #endif
         else if(mystrncasecmp(restofline,"UseStyle",8)==0)
         {
+          int is_quoted = 0;
           restofline +=8;
           while(isspace(*restofline))restofline++;
+          if (*restofline == '"') {
+              is_quoted = 1;
+              ++restofline;
+          }
           tmp = restofline;
-          while( tmp && *tmp &&(*tmp != ',')&&
-                 (*tmp != '\n')&&(!isspace(*tmp)))
+          len = 0;
+          while (tmp && *tmp &&
+                 ((!is_quoted&&(*tmp != ',')&&(*tmp != '\n')&&(!isspace(*tmp)))
+                  || (is_quoted&&(*tmp != '\n')&&(*tmp != '"'))))
+	  {
             tmp++;
-          if((len = tmp - restofline) > 0)
+	    len++;
+	  }
+          if (tmp && (*tmp == '"')) ++tmp;
+          if (len > 0)
           {
             nptr = Scr.TheList;
             while(nptr && mystrncasecmp(restofline,nptr->name,len) )
--
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].