Print this page
5088 it's probably ok for vi to stop working around pdp-11 bugs now


 907                         break;
 908 
 909                 case ' ':
 910                         i++;
 911                         break;
 912 
 913                 default:
 914                         return (i);
 915                 }
 916 }
 917 
 918 void
 919 markit(line *addr)
 920 {
 921 
 922         if (addr != dot && addr >= one && addr <= dol)
 923                 markDOT();
 924 }
 925 
 926 /*
 927  * The following code is defensive programming against a bug in the
 928  * pdp-11 overlay implementation.  Sometimes it goes nuts and asks
 929  * for an overlay with some garbage number, which generates an emt
 930  * trap.  This is a less than elegant solution, but it is somewhat
 931  * better than core dumping and losing your work, leaving your tty
 932  * in a weird state, etc.
 933  */
 934 int _ovno;
 935 
 936 /*ARGSUSED*/
 937 void 
 938 onemt(sig)
 939 int sig;
 940 {
 941         int oovno;
 942 
 943         signal(SIGEMT, onemt);
 944         oovno = _ovno;
 945         /* 2 and 3 are valid on 11/40 type vi, so */
 946         if (_ovno < 0 || _ovno > 3)
 947                 _ovno = 0;
 948         error(value(vi_TERSE) ? gettext("emt trap, _ovno is %d ") :
 949 gettext("emt trap, _ovno is %d   - try again"));
 950 }
 951 
 952 /*
 953  * When a hangup occurs our actions are similar to a preserve
 954  * command.  If the buffer has not been [Modified], then we do
 955  * nothing but remove the temporary files and exit.
 956  * Otherwise, we sync the temp file and then attempt a preserve.
 957  * If the preserve succeeds, we unlink our temp files.
 958  * If the preserve fails, we leave the temp files as they are
 959  * as they are a backup even without preservation if they
 960  * are not removed.
 961  */
 962 
 963 /*ARGSUSED*/
 964 void 
 965 onhup(sig)
 966 int sig;
 967 {
 968 
 969         /*
 970          * USG tty driver can send multiple HUP's!!
 971          */
 972         signal(SIGINT, SIG_IGN);




 907                         break;
 908 
 909                 case ' ':
 910                         i++;
 911                         break;
 912 
 913                 default:
 914                         return (i);
 915                 }
 916 }
 917 
 918 void
 919 markit(line *addr)
 920 {
 921 
 922         if (addr != dot && addr >= one && addr <= dol)
 923                 markDOT();
 924 }
 925 
 926 /*


























 927  * When a hangup occurs our actions are similar to a preserve
 928  * command.  If the buffer has not been [Modified], then we do
 929  * nothing but remove the temporary files and exit.
 930  * Otherwise, we sync the temp file and then attempt a preserve.
 931  * If the preserve succeeds, we unlink our temp files.
 932  * If the preserve fails, we leave the temp files as they are
 933  * as they are a backup even without preservation if they
 934  * are not removed.
 935  */
 936 
 937 /*ARGSUSED*/
 938 void
 939 onhup(sig)
 940 int sig;
 941 {
 942 
 943         /*
 944          * USG tty driver can send multiple HUP's!!
 945          */
 946         signal(SIGINT, SIG_IGN);