[comp.soft-sys.andrew] Fwd: tm fix

janssen@parc.xerox.com (Bill Janssen) (06/09/90)

[ I don't really know if anyone is tracking tm... ]

---------- Forwarded message begins here ----------

X-Andrew-Authenticated-As: 0;holmes.parc.xerox.com;Operator
From vanMelle.pa@Xerox.COM Fri Jun  8 19:22:01 1990
Received: from Xerox.COM by pooh.parc.xerox.com with SMTP
	(5.61+/IDA-1.2.8/gandalf) id AA13447; Fri, 8 Jun 90 19:21:58 PDT
Received: from Semillon.ms by ArpaGateway.ms ; 08 JUN 90 19:17:33 PDT
Date: 8 Jun 90 19:17 PDT
From: vanMelle.pa@Xerox.COM
Subject: tm fix
To: janssen@parc.xerox.com
Cc: vanMelle.pa@Xerox.COM
Message-Id: <900608-191733-5441@Xerox>

I changed line 766 in tm.c to read

		action=escapes[(unsigned char)*end];

(the cast is what's added.)  

I was thinking that the ^A handler wouldn't be so bad if it just had a
sanity check in it.  Like, if it encounters an end of line or non-ascii
character before it overflows its buffer or encounters ^B, it should just
punt to the regular character handler.  So I made that change to
~vanmelle/andrew/mytm/tm.c as well, and it seems to work.

	Bill


    94 % diff -c /a/contrib/tm/tm.c ~vanmelle/andrew/mytm/tm.c
    *** /a/contrib/tm/tm.c      Fri Apr 13 02:22:13 1990
    --- /net/piglet/piglet/vanmelle/andrew/mytm/tm.c    Fri Jun  8
    18:59:59 1990
    ***************
    *** 666,676 ****
    --- 666,682 ----
      {
          char *dir=self->parseBuf+self->parseLen;
          int left=sizeof(self->parseBuf)-self->parseLen;
    +     char *origbuf = buf;
      
          if(*buf=='\001')
        buf++;
      
          while(len-->0 && *buf!='\002' && left>0){
    +         if (*buf < ' ' || *buf >= '\177')
    +     {     /* Unlikely character, assume he's not really calling
    readDir */
    +       termulator_WriteChars(self, origbuf, 1);
    +       return origbuf+1;
    +     }
        *dir++= *buf++;
        self->parseLen++;
        left--;
    ***************
    *** 763,769 ****
      
        if(action==NULL){
            do{
    !           action=escapes[*end];
                if(action!=NULL)
                    break;
                end++;
    --- 769,775 ----
      
        if(action==NULL){
            do{
    !           action=escapes[(unsigned char)*end];
                if(action!=NULL)
                    break;
                end++;