document distributed with 4.1BSD
[unix-history] / usr / src / usr.bin / ex / ex_voper.c
index d9e1da8..725b474 100644 (file)
@@ -1,5 +1,13 @@
-/* Copyright (c) 1980 Regents of the University of California */
-static char *sccsid = "@(#)ex_voper.c  5.1 %G%";
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)ex_voper.c  7.4 (Berkeley) %G%";
+#endif not lint
+
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -30,7 +38,7 @@ operate(c, cnt)
        register line *addr;
        line *odot;
        static char lastFKND, lastFCHR;
        register line *addr;
        line *odot;
        static char lastFKND, lastFCHR;
-       char d;
+       short d;
 
        moveop = vmove, deleteop = vdelete;
        wcursor = cursor;
 
        moveop = vmove, deleteop = vdelete;
        wcursor = cursor;
@@ -106,8 +114,8 @@ operate(c, cnt)
         *              character.
         */
        case 'r':
         *              character.
         */
        case 'r':
-               vrep(cnt);
                vmacchng(1);
                vmacchng(1);
+               vrep(cnt);
                return;
 
        default:
                return;
 
        default:
@@ -215,6 +223,10 @@ ein:
        case '%':
                vsave();
                i = lmatchp((line *) 0);
        case '%':
                vsave();
                i = lmatchp((line *) 0);
+#ifdef TRACE
+               if (trace)
+                       fprintf(trace, "after lmatchp in %, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol));
+#endif
                getDOT();
                forbid(!i);
                if (opf != vmove)
                getDOT();
                forbid(!i);
                if (opf != vmove)