Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.13 $; site uiucdcs.UUCP Path: utzoo!watmath!clyde!burl!hou3c!hocda!houxm!ihnp4!inuxc!pur-ee!uiucdcs!liberte From: liberte@uiucdcs.UUCP Newsgroups: net.bugs.4bsd Subject: Re: 4.2 TSET minor bug fix - (nf) Message-ID: <8200017@uiucdcs.UUCP> Date: Wed, 18-Apr-84 02:49:00 EST Article-I.D.: uiucdcs.8200017 Posted: Wed Apr 18 02:49:00 1984 Date-Received: Thu, 19-Apr-84 03:21:50 EST References: <33500002@parsec.UUCP> Lines: 21 Nf-ID: #R:parsec:33500002:uiucdcs:8200017:000:776 Nf-From: uiucdcs!liberte Apr 18 01:49:00 1984 #R:parsec:33500002:uiucdcs:8200017:000:776 uiucdcs!liberte Apr 18 01:49:00 1984 /**** uiucdcs:net.bugs.4bsd / uiuccsb!emrath / 9:25 pm Apr 10, 1984 ****/ You won't be able to use 'tset -e^?' to use rubout for erasing. Some people have been known to do this. How 'bout? #define CTRL(x) ((x) & ~((x) >> 1 & 040) ^ 0100) /* P.U. */ or #define CTRL(x) ((x) & 0100 ? (x) &~ 0140 : (x) | 0100) /* ---------- */ These two attempts fail because of actual parameter evaluation side effects, i.e. the flag pointer is incremented. One fix is to change the macro calls. My fix is to use the parameter only once. This will work on 2s complement machines (like VAX). # define CTRL(x) (((((x) + 1) &~ 0140) - 1) & 0177) /* is it worth it? */ Daniel LaLiberte, U of Illinois, Urbana-Champaign, Computer Science {moderation in all things - including moderation}