🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #826

Re: Help needed for Logo on Unix

#826
From: M.P.Lindner
Date: Thu, 23 Jul 1987 15:16
70 lines
3394 bytes
In article <1271@ihlpm.ATT.COM>, nevets@ihlpm.ATT.COM (Steven R Ringwood) writes:
> There was a note about making sure YYDEBUG is defined or lines
> of the form "#if YYDEBUG" will cause problems.
> If you make the following change to logo.h, it will make sure
> that YYDEBUG is defined to a known value.
> This fixed the problem for me.

Right you are, Steve.  This was my solution as well, but since I didn't
keep track of what I did to fix it and was too lazy to do diffs against
the original source, my posting was a little sketchy.

> Also, i was having problems with parsing which turned out to be a
> problem in yylex1().
> It defines a local variable c of type char, but the function
> getchar returns a value of type FAST (int).
> This is a common problem and is solved by changing the local
> variable c to type FAST.
> The behavior that results from this error was typing something
> to logo that used a new function, off went logo into never-never
> land because the EOF was not seen.

Well, right again.  I had missed this one (since I didn't run across the
deviant behavior), but it looks like there are several places where an
unexpected EOF could cause an infinite loop.  I made the following
changes to logo.y:
$ diff OLDlogo.y logo.y 
41c41
< char charib =0;
---
> int charib =0;
662c662
<       char c;
---
>       int c;
695c695
<               while (!index(" \t\n[](){}\";",(c = getchar()))) {
---
>               while ((c = getchar()) != EOF && !strchr(" \t\n[](){}\";",c)) {
707c707,708
<               while (( (c=getchar())>='a' && c<='z' )
---
>               while ( (c = getchar()) != EOF && (
>                               (c >='a' && c<='z' )
709c710
<                               || (c=='.') || (c=='_') ) {
---
>                               || (c=='.') || (c=='_')) ) {
740c741
<               while ((c=getchar()) && (c != '\n')) ;
---
>               while ((c=getchar()) != EOF && (c != '\n')) ;
784c785,786
<                       c=getchar();
---
>                       if ((c=getchar()) == EOF)
>                               break;

apparently the code expected 0 on EOF.  Note that I also changed index()
to strchr() (since I'm on a System V machine).  I also changed charib
to be an int everywhere it is defined (3 files affected by this - use
grep to find them - I'm lazy again).

Anyway, that about does it for me.  I'm quite happy with logo.  I have
I*M Logo (you know, the "I" word, "Big Blue", etc) for my AT&T (yay) PC
and I like that, although I don't use it much.  I was looking for a good
free logo for UNIX(R) for a while (UNIX is a registered trademark of AT&T).
Happy turtles!

Mike Lindner
...!ihnp4!attunix!mpl
Technical Details
Message-ID: <1679@sfsup.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!husc6!mit-eddie!ll-xn!ames!ptsfa!ihnp4!homxb!mhuxt!mhuxm!mhuxo!ulysses!sfmag!sfsup!mpl
References: <1740@encore.UUCP> <330@rabbit1.UUCP> <1649@sfsup.UUCP> <1271@ihlpm.ATT.COM>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!husc6!mit-eddie!ll-xn!ames!ptsfa!ihnp4!homxb!mhuxt!mhuxm!mhuxo!ulysses!sfmag!sfsup!mpl
From: mpl@sfsup.UUCP (M.P.Lindner)
Newsgroups: comp.sources.bugs
Subject: Re: Help needed for Logo on Unix
Message-ID: <1679@sfsup.UUCP>
Date: Thu, 23-Jul-87 11:16:17 EDT
Article-I.D.: sfsup.1679
Posted: Thu Jul 23 11:16:17 1987
Date-Received: Sat, 25-Jul-87 12:57:07 EDT
References: <1740@encore.UUCP> <330@rabbit1.UUCP> <1649@sfsup.UUCP> <1271@ihlpm.ATT.COM>
Organization: AT&T-IS, Summit N.J. USA
Lines: 70
Summary: it's worse than that