changed INDEX operator to handle multiple subscript arrays correctly
[unix-history] / usr / src / usr.bin / ex / ex_put.c
index c517f32..ceeaf0d 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_put.c    7.4     %G%";
+static char *sccsid = "@(#)ex_put.c    7.7     %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -565,7 +565,7 @@ dontcr:
        /* Move down, if necessary, until we are at the desired line */
        while (outline < destline) {
                j = destline - outline;
        /* Move down, if necessary, until we are at the desired line */
        while (outline < destline) {
                j = destline - outline;
-               if (j > costDP) {
+               if (j > costDP && DOWN_PARM) {
                        /* Win big on Tek 4025 */
                        tputs(tgoto(DOWN_PARM, 0, j), j, plodput);
                        outline += j;
                        /* Win big on Tek 4025 */
                        tputs(tgoto(DOWN_PARM, 0, j), j, plodput);
                        outline += j;
@@ -595,7 +595,7 @@ dontcr:
                        continue;
                }
                j = outcol - destcol;
                        continue;
                }
                j = outcol - destcol;
-               if (j > costLP) {
+               if (j > costLP && LEFT_PARM) {
                        tputs(tgoto(LEFT_PARM, 0, j), j, plodput);
                        outcol -= j;
                }
                        tputs(tgoto(LEFT_PARM, 0, j), j, plodput);
                        outcol -= j;
                }
@@ -610,7 +610,7 @@ dontcr:
        /* Move up, if necessary, to desired row */
        while (outline > destline) {
                j = outline - destline;
        /* Move up, if necessary, to desired row */
        while (outline > destline) {
                j = outline - destline;
-               if (j > 1) {
+               if (UP_PARM && j > 1) {
                        /* Win big on Tek 4025 */
                        tputs(tgoto(UP_PARM, 0, j), j, plodput);
                        outline -= j;
                        /* Win big on Tek 4025 */
                        tputs(tgoto(UP_PARM, 0, j), j, plodput);
                        outline -= j;
@@ -665,7 +665,7 @@ dontcr:
         */
        while (outcol < destcol) {
                j = destcol - outcol;
         */
        while (outcol < destcol) {
                j = destcol - outcol;
-               if (j > costRP) {
+               if (j > costRP && RIGHT_PARM) {
                        /*
                         * This probably happens rarely, if at all.
                         * It seems mainly useful for ANSI terminals
                        /*
                         * This probably happens rarely, if at all.
                         * It seems mainly useful for ANSI terminals
@@ -1023,7 +1023,7 @@ tostop()
 {
        putpad(VE);
        putpad(KE);
 {
        putpad(VE);
        putpad(KE);
-       if (!value(MESG))
+       if (!value(MESG) && ttynbuf[0]>1)
                chmod(ttynbuf, ttymesg);
 }
 
                chmod(ttynbuf, ttymesg);
 }