Re: FVWM: [Question] about Style/UseStyle: manual/code mismatch

From: Todd Fries <tfries_at_umr.edu>
Date: Sat, 16 Mar 1996 22:57:02 -0600 (CST)

> The manual of fvwm says:
[...]
> And, fvwm/style.c says:
[...]
> Assume that following line is written in the configulation file.
> Style "XTerm" NoTitle
> Style "rxvt" UseStyle "XTerm"

> If we trust the manual, style of rxvt is the same of XTerm. But fvwm
> complains about this description, i.e.,
>
> fvwm: UseStyle: "XTerm" style not found!
>
> It is natual when you see the code (see the condition of the while
> loop). Second line should be:
>
> Style "rxvt" UseStyle XTerm
>
> My question is simple: Which is the true, manual or code ?

Oops! This was my patch...I didn't write the man page, and I knew
this was a problem...the intentions were what the man page says,
but it behaves as in your last example.

The following *SHOULD* do the right thing:
-----begin patch-----
--- style.c.old Sun Feb 18 14:27:56 1996
+++ style.c Sat Mar 16 22:30:35 1996
_at_@ -536,45 +536,45 @@
         else if(mystrncasecmp(restofline,"UseStyle",8)==0)
         {
           restofline +=8;
+
           while(isspace(*restofline))restofline++;
- tmp = restofline;
- while( tmp && *tmp &&(*tmp != ',')&&
- (*tmp != '\n')&&(!isspace(*tmp)))
- tmp++;
- if((len = tmp - restofline) > 0)
+
+ restofline = GetNextToken(restofline,&tmp);
+
+ /* in case there was no argument! */
+ if((name == NULL)||(restofline == NULL)) return;
+
+ nptr = Scr.TheList;
+ while(nptr && mystrcasecmp(tmp,nptr->name) )
+ nptr = nptr->next;
+ if (nptr&& !mystrcasecmp(tmp,nptr->name))
           {
- nptr = Scr.TheList;
- while(nptr && mystrncasecmp(restofline,nptr->name,len) )
- nptr = nptr->next;
- if (nptr&& !mystrncasecmp(restofline,nptr->name,len))
- {
- on_flags = nptr->on_flags;
- off_flags = nptr->off_flags;
- icon_name = nptr->value;
- desknumber = nptr->Desk;
- bw = nptr->border_width;
- nobw = nptr->resize_width;
- forecolor = nptr->ForeColor;
- backcolor = nptr->BackColor = backcolor;
- BoxFillMethod = nptr->BoxFillMethod;
- IconBox[0] = nptr->IconBox[0];
- IconBox[1] = nptr->IconBox[1];
- IconBox[2] = nptr->IconBox[2];
- IconBox[3] = nptr->IconBox[3];
- off_buttons = nptr->off_buttons;
- on_buttons = nptr->on_buttons;
- restofline = tmp;
- }
- else
- {
- restofline = tmp;
- tmp=safemalloc(500);
- strcat(tmp,"UseStyle: ");
- strncat(tmp,restofline-len,len);
- strcat(tmp," style not found!");
- fvwm_err(tmp,NULL,NULL,NULL);
- free(tmp);
- }
+ on_flags = nptr->on_flags;
+ off_flags = nptr->off_flags;
+ icon_name = nptr->value;
+ desknumber = nptr->Desk;
+ bw = nptr->border_width;
+ nobw = nptr->resize_width;
+ forecolor = nptr->ForeColor;
+ backcolor = nptr->BackColor = backcolor;
+ BoxFillMethod = nptr->BoxFillMethod;
+ IconBox[0] = nptr->IconBox[0];
+ IconBox[1] = nptr->IconBox[1];
+ IconBox[2] = nptr->IconBox[2];
+ IconBox[3] = nptr->IconBox[3];
+ off_buttons = nptr->off_buttons;
+ on_buttons = nptr->on_buttons;
+ }
+ else
+ {
+ len = strlen(tmp);
+ free(tmp);
+ tmp=safemalloc(10 + len + 17 + 1);
+ strcat(tmp,"UseStyle: ");
+ strncat(tmp,restofline-len,len);
+ strcat(tmp," style not found!");
+ fvwm_err(tmp,NULL,NULL,NULL);
+ free(tmp);
           }
           while(isspace(*restofline)) restofline++;
         }
-------endofpatch---------

but for some strange reason I get an error while trying
to compile fvwm, so I am unable to verify the functionality
of this:

gcc -o FvwmForm FvwmForm.o -O4 -m486 -ansi -L/usr/X11R6/lib -L../../libs -lf
vwm -lXpm -lXExExt -lXext -lX11 -Wl,-rpath,/usr/X11R6/lib
FvwmForm.o(.text+0x264): undefined reference to `GetFontOrFixed'
FvwmForm.o(.text+0x7f8): undefined reference to `GetFontOrFixed'
FvwmForm.o(.text+0x8d8): undefined reference to `GetFontOrFixed'
FvwmForm.o(.text+0x9b8): undefined reference to `GetFontOrFixed'
make[2]: *** [FvwmForm] Error 1

Where is 'GetFontOnFixed' anyway?
-- 
Todd Fries...tfries_at_umr.edu
http://www.umr.edu/~tfries
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Sat Mar 16 1996 - 22:57:31 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:58 BST