Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/nvi/dist/ex Use wp and wlen instead of ip and i...



details:   https://anonhg.NetBSD.org/src/rev/a5e25bdb906c
branches:  trunk
changeset: 365227:a5e25bdb906c
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Aug 07 11:41:23 2018 +0000

description:
Use wp and wlen instead of ip and ilen for consistency.
No binary changes intended.

diffstat:

 external/bsd/nvi/dist/ex/ex_script.c |  40 ++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diffs (118 lines):

diff -r d78186615438 -r a5e25bdb906c external/bsd/nvi/dist/ex/ex_script.c
--- a/external/bsd/nvi/dist/ex/ex_script.c      Tue Aug 07 11:25:45 2018 +0000
+++ b/external/bsd/nvi/dist/ex/ex_script.c      Tue Aug 07 11:41:23 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ex_script.c,v 1.8 2017/11/06 03:27:34 rin Exp $ */
+/*     $NetBSD: ex_script.c,v 1.9 2018/08/07 11:41:23 rin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
@@ -19,7 +19,7 @@
 static const char sccsid[] = "Id: ex_script.c,v 10.38 2001/06/25 15:19:19 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:19 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: ex_script.c,v 1.8 2017/11/06 03:27:34 rin Exp $");
+__RCSID("$NetBSD: ex_script.c,v 1.9 2018/08/07 11:41:23 rin Exp $");
 #endif
 
 #include <sys/types.h>
@@ -262,17 +262,17 @@
        ssize_t nw;
        char *bp = NULL;
        const char *p;
-       const CHAR_T *ip;
-       size_t ilen;
+       const CHAR_T *wp;
+       size_t wlen;
 
        sc = sp->script;
 
        /* If there's a prompt on the last line, append the command. */
        if (db_last(sp, &last_lno))
                return (1);
-       if (db_get(sp, last_lno, DBG_FATAL, __UNCONST(&ip), &ilen))
+       if (db_get(sp, last_lno, DBG_FATAL, __UNCONST(&wp), &wlen))
                return (1);
-       INT2CHAR(sp, ip, ilen, p, last_len);
+       INT2CHAR(sp, wp, wlen, p, last_len);
        if (last_len == sc->sh_prompt_len &&
            memcmp(p, sc->sh_prompt, last_len) == 0) {
                matchprompt = 1;
@@ -282,16 +282,16 @@
                matchprompt = 0;
 
        /* Get something to execute. */
-       if (db_eget(sp, lno, __UNCONST(&ip), &ilen, &isempty)) {
+       if (db_eget(sp, lno, __UNCONST(&wp), &wlen, &isempty)) {
                if (isempty)
                        goto empty;
                goto err1;
        }
 
        /* Empty lines aren't interesting. */
-       if (ilen == 0)
+       if (wlen == 0)
                goto empty;
-       INT2CHAR(sp, ip, ilen, p, len);
+       INT2CHAR(sp, wp, wlen, p, len);
 
        /* Delete any prompt. */
        if (len >= sc->sh_prompt_len &&
@@ -318,8 +318,8 @@
        if (matchprompt) {
                ADD_SPACE_GOTO(sp, char, bp, blen, last_len + len);
                memmove(bp + last_len, p, len);
-               CHAR2INT(sp, bp, last_len + len, ip, ilen);
-               if (db_set(sp, last_lno, ip, ilen))
+               CHAR2INT(sp, bp, last_len + len, wp, wlen);
+               if (db_set(sp, last_lno, wp, wlen))
 err1:                  rval = 1;
        }
        if (matchprompt)
@@ -432,8 +432,8 @@
        size_t len;
        ssize_t nr;
        char bp[1024];
-       const CHAR_T *ip;
-       size_t ilen = 0;
+       const CHAR_T *wp;
+       size_t wlen = 0;
 
        /* Find out where the end of the file is. */
        if (db_last(sp, &lno))
@@ -459,8 +459,8 @@
        for (p = t = bp; p < endp; ++p) {
                if (*p == '\r' || *p == '\n') {
                        len = p - t;
-                       if (CHAR2INT(sp, t, len, ip, ilen) ||
-                           db_append(sp, 1, lno++, ip, ilen))
+                       if (CHAR2INT(sp, t, len, wp, wlen) ||
+                           db_append(sp, 1, lno++, wp, wlen))
                                return (1);
                        t = p + 1;
                }
@@ -481,8 +481,8 @@
                FD_SET(sc->sh_master, &rdfd);
                if (select(sc->sh_master + 1, &rdfd, NULL, NULL, &tv) == 1) {
                        if (len == sizeof(bp)) {
-                               if (CHAR2INT(sp, t, len, ip, ilen) ||
-                                   db_append(sp, 1, lno++, ip, ilen))
+                               if (CHAR2INT(sp, t, len, wp, wlen) ||
+                                   db_append(sp, 1, lno++, wp, wlen))
                                        return (1);
                                endp = bp;
                        } else {
@@ -497,10 +497,10 @@
 
        /* Append the remains into the file, and the cursor moves to EOF. */
        if (len > 0) {
-               if (CHAR2INT(sp, t, len, ip, ilen) ||
-                   db_append(sp, 1, lno++, ip, ilen))
+               if (CHAR2INT(sp, t, len, wp, wlen) ||
+                   db_append(sp, 1, lno++, wp, wlen))
                        return (1);
-               sp->cno = ilen - 1;
+               sp->cno = wlen - 1;
        } else
                sp->cno = 0;
        sp->lno = lno;



Home | Main Index | Thread Index | Old Index