Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 1996 10:46:44 +0100 (MET)
From:      Mikko Tyolajarvi <mikko@dynas.se>
To:        bugs@FreeBSD.org
Subject:   iijppp (2.1-RELEASE). Chatscript buglet.
Message-ID:  <Pine.SOL.3.91.960131104249.17796A-100000@spirit.dynas.se>

next in thread | raw e-mail | index | archive | help

In case anyone is interested,

I stumbled into this cute bug in user ppp (from the 2.1-RELEASE CD).  It
causes chatscripts to fail to to match any string that is immediately
preceeded by a leading substring of itself.

I.e. when expecting "FooBar", "FooFooBar" will pass by unnoticed, or (ho=
w I
found out), it is not possible to wait for a "Password:" prompt using th=
e
string "sword:"...


Here is one way to fix it:

*** chat.c.org  Fri Jan 19 13:06:00 1996
--- chat.c      Fri Jan 19 13:06:53 1996
***************
*** 266,272 ****
            return(MATCH);
          }
          } else {
!         s =3D str;
          if (inp =3D=3D inbuff+ IBSIZE) {
            bcopy(inp - 100, inbuff, 100);
            inp =3D inbuff + 100;
--- 266,272 ----
            return(MATCH);
          }
          } else {
!         s =3D (ch =3D=3D *str) ? str+1 : str;
          if (inp =3D=3D inbuff+ IBSIZE) {
            bcopy(inp - 100, inbuff, 100);
            inp =3D inbuff + 100;


BTW: The chat program doesn't have this problem.

=09=09Regards,
=09=09/Mikko


 Mikko Ty=F6l=E4j=E4rvi (mikko@dynas.se)              <Insert cheesy quo=
te here>
 DynaSoft, Dynamic Software AB





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.91.960131104249.17796A-100000>