Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!mcsun!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.sources.bugs Subject: pac - core dumps and oddities (with fixes) Message-ID: <1990Aug6.172508.6109@warwick.ac.uk> Date: 6 Aug 90 17:25:08 GMT Sender: news@warwick.ac.uk (Network news) Organization: Computing Services, Warwick University, UK Lines: 401 I've just been looking at pac, the calculator. It seems a fairly nice piece of work (shame it doesn't work on Sun3s...anyone know a fix for this ?). There are however a few buglets/wierdos. It tries to write to constant strings in a few places---instant core dump with ANSI compilers. In the Newconv menu, if you just hit return it dumps core trying to write to a NULL pointer. Delete works really strangely, these patches make it work like the normal Unix delete, and every editor I've ever used (except XEDIT, but I'm not planning on making *anything* look like XEDIT :-). There was no way to suspend pac, which is really invaluable in a tool like this. I've put this on ^Z for systems that have SIGTSTP. The ASCII printout of control characters was really wierd, I've never seen ^| ^/ or ^` anywhere before, I've changed it to print out the normal ^[ ^\ ^] ^_ ^^ as Unix does. All I miss now is a way to abort things I entered by accident (Newconv, File, etc.), an `apropos' function, and a way to scroll the help and conversion windows ... another day maybe. Have fun, Rob =================================================================== RCS file: defs.h,v retrieving revision 1.1 diff -c -r1.1 defs.h *** /tmp/,RCSt1a02499 Mon Aug 6 18:12:43 1990 --- defs.h Mon Aug 6 12:21:59 1990 *************** *** 165,171 **** }; char *Titlq[TREQ]; char *Basq[BREQ]; ! char *Bb[] = { "TAB bye Exit Redraw File Postpend Klock Globals Loan Newconv Total ", " File Postpend Toggle_back copy: a...t up_down: A...S transfer: T ", "file write: hardcopy ", --- 165,171 ---- }; char *Titlq[TREQ]; char *Basq[BREQ]; ! char Bb[][TITSIZ + 1] = { "TAB bye Exit Redraw File Postpend Klock Globals Loan Newconv Total ", " File Postpend Toggle_back copy: a...t up_down: A...S transfer: T ", "file write: hardcopy ", *************** *** 176,187 **** "new value = ", "new formula: " }; ! char *Hardname = ! "hardcopy "; ! char *Totname = ! "hardtotal "; ! char *Amortname = ! "hardamort "; char Spreadbuf[PIPEMAX * 2]; /* expand user input for tokenizing */ char Tokbuf[PIPEMAX]; /* strcomp against key list */ --- 176,184 ---- "new value = ", "new formula: " }; ! char Hardname[64] = "hardcopy"; ! char Totname[64] = "hardtotal"; ! char Amortname[64] = "hardamort"; char Spreadbuf[PIPEMAX * 2]; /* expand user input for tokenizing */ char Tokbuf[PIPEMAX]; /* strcomp against key list */ *************** *** 306,312 **** extern char *Titlq[]; extern char *Basq[]; extern char *Cb[], *Sb[]; ! extern char *Bb[]; extern char Spreadbuf[]; extern char Tokbuf[]; extern char Controlbuf[]; --- 303,309 ---- extern char *Titlq[]; extern char *Basq[]; extern char *Cb[], *Sb[]; ! extern char Bb[][TITSIZ + 1]; extern char Spreadbuf[]; extern char Tokbuf[]; extern char Controlbuf[]; *************** *** 335,343 **** extern int Rcfd, Rcerr; extern char Onebuf[STACKMAX + 1]; extern int Hardcopy, Hc, Hf; ! extern char *Hardname; ! extern char *Amortname; ! extern char *Totname; extern int Totcopy, Tc, Tqlev; extern int Autoconv; extern int Convcount; --- 332,340 ---- extern int Rcfd, Rcerr; extern char Onebuf[STACKMAX + 1]; extern int Hardcopy, Hc, Hf; ! extern char Hardname[]; ! extern char Amortname[]; ! extern char Totname[]; extern int Totcopy, Tc, Tqlev; extern int Autoconv; extern int Convcount; =================================================================== RCS file: ledit.c,v retrieving revision 1.1 diff -c -r1.1 ledit.c *** /tmp/,RCSt1a02499 Mon Aug 6 18:12:44 1990 --- ledit.c Mon Aug 6 18:08:53 1990 *************** *** 163,178 **** /* curr line: delete char and move 1 pos to left */ case 11: for (ri = CX + 1; ri <= rbound; ri++) addch(stdscr->_y[CY][ri]); addch(' '); - if (--CX < lbound) - ++CX; move(CY,CX); break; /* across lines: delete char and move 1 pos to left */ case 16: for (ri = CX + 1; ri <= rbound; ri++) addch(stdscr->_y[CY][ri]); for (rj = CY + 1; rj <= bbound; rj++) { --- 163,187 ---- /* curr line: delete char and move 1 pos to left */ case 11: + if (--CX < lbound) + ++CX; + move(CY,CX); for (ri = CX + 1; ri <= rbound; ri++) addch(stdscr->_y[CY][ri]); addch(' '); move(CY,CX); break; /* across lines: delete char and move 1 pos to left */ case 16: + if (--CX < lbound) { + if (--CY < tbound) { + ++CX; ++CY; + } else { + CX = rbound; + } + } + move(CY,CX); for (ri = CX + 1; ri <= rbound; ri++) addch(stdscr->_y[CY][ri]); for (rj = CY + 1; rj <= bbound; rj++) { *************** *** 182,189 **** addch(stdscr->_y[rj][ri]); } addch(' '); - if (--CX < lbound) - ++CX; move(CY,CX); break; --- 191,196 ---- *************** *** 198,206 **** --- 205,226 ---- case 20 : insert = 0; break; + + case 26 : + #ifdef SIGTSTP + kill(0, SIGTSTP); + clearok(curscr, TRUE); + #endif + break; } standend(); pfresh(); + } + + if (retbuf == ZERO) { + pfresh(); + TR_ + return(retval); } rp = retbuf; =================================================================== RCS file: maps.h,v retrieving revision 1.1 diff -c -r1.1 maps.h *** /tmp/,RCSt1a02499 Mon Aug 6 18:12:44 1990 --- maps.h Mon Aug 6 17:25:14 1990 *************** *** 10,16 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 9, 10, 0, 1, 0, 0, 11, 7, 0, 0, 8, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 10,16 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 9, 10, 0, 1, 0, 0, 11, 7, 0, 0, 8, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 29,35 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 29,35 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 48,54 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 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- . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 91,97 **** "DLE ^P", "DC1 ^Q", "DC2 ^R", "DC3 ^S", "DC4 ^T", "NAK ^U", "SYN ^V", "ETB ^W", "CAN ^X", "EM ^Y", "SUB ^Z", "ESC ^[", ! "FS ^|", "GS ^]", "RS ^`", "US ^/", "asc SP" }; --- 91,97 ---- "DLE ^P", "DC1 ^Q", "DC2 ^R", "DC3 ^S", "DC4 ^T", "NAK ^U", "SYN ^V", "ETB ^W", "CAN ^X", "EM ^Y", "SUB ^Z", "ESC ^[", ! "FS ^\\", "GS ^]", "RS ^^", "US ^_", "asc SP" }; *************** *** 102,108 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 102,108 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 121,127 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 121,127 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 140,146 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 0, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 140,146 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 0, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 161,167 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 161,167 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 10, 0, 1, 0, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ *************** *** 183,191 **** 0, 17, 17, 10, 17, 1, 17, 17, 11, 7, 17, 17, 17, 17, 17, 17, #ifdef DESIGN /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 17, 0, 18, 0, 17, 17, 0, 0, 17, 17, 0, 20, 0, 0, 0, 0, #else ! 17, 0, 18, 17, 17, 0, 0, 0, 17, 0, 0, 20, 0, 0, 0, 0, #endif /* SP ! " # $ % & ' ( ) * + , - . / */ 2, 2, 0, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, --- 183,191 ---- 0, 17, 17, 10, 17, 1, 17, 17, 11, 7, 17, 17, 17, 17, 17, 17, #ifdef DESIGN /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 17, 0, 18, 0, 17, 17, 0, 0, 17, 17, 26, 20, 0, 0, 0, 0, #else ! 17, 0, 18, 17, 17, 0, 0, 0, 17, 0, 26, 20, 0, 0, 0, 0, #endif /* SP ! " # $ % & ' ( ) * + , - . / */ 2, 2, 0, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, *************** *** 207,213 **** /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 12, 0, 1, 12, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 12, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 21, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ --- 207,213 ---- /* NL ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O */ 0, 0, 0, 12, 0, 1, 12, 0, 11, 7, 0, 0, 0, 0, 0, 0, /* ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^| ^] ^` ^/ */ ! 12, 0, 0, 0, 8, 0, 0, 0, 0, 0, 26, 20, 0, 0, 0, 0, /* SP ! " # $ % & ' ( ) * + , - . / */ 10, 0, 0, 21, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ -- UUCP: ...!mcsun!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick INET: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England