Source-Changes-HG archive

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

[src/netbsd-3]: src/usr.bin/vi/ex Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/bce234a26fee
branches:  netbsd-3
changeset: 577351:bce234a26fee
user:      riz <riz%NetBSD.org@localhost>
date:      Sat Oct 15 15:41:50 2005 +0000

description:
Pull up following revision(s) (requested by aymeric in ticket #878):
        usr.bin/vi/ex/ex_argv.c: revision 1.15
accept ^V again as a quoting character. At least one person uses it. (hi
abs!)
While there, fix a bug that would swallow a quoting character if it were the
last one.

diffstat:

 usr.bin/vi/ex/ex_argv.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 68f2895ecc68 -r bce234a26fee usr.bin/vi/ex/ex_argv.c
--- a/usr.bin/vi/ex/ex_argv.c   Sat Oct 15 15:41:12 2005 +0000
+++ b/usr.bin/vi/ex/ex_argv.c   Sat Oct 15 15:41:50 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ex_argv.c,v 1.12.2.2 2005/09/09 15:01:44 tron Exp $    */
+/*     $NetBSD: ex_argv.c,v 1.12.2.3 2005/10/15 15:41:50 riz Exp $     */
 
 /*-
  * Copyright (c) 1993, 1994
@@ -16,7 +16,7 @@
 #if 0
 static const char sccsid[] = "@(#)ex_argv.c    10.26 (Berkeley) 9/20/96";
 #else
-__RCSID("$NetBSD: ex_argv.c,v 1.12.2.2 2005/09/09 15:01:44 tron Exp $");
+__RCSID("$NetBSD: ex_argv.c,v 1.12.2.3 2005/10/15 15:41:50 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -291,7 +291,8 @@
                 */
                for (ap = cmd, len = 0; cmdlen > 0; ++cmd, --cmdlen, ++len) {
                        ch = *cmd;
-                       if (ch == '\\' && cmdlen > 1) {
+                       if ((IS_ESCAPE(sp, excp, ch) || ch == '\\') &&
+                           cmdlen > 1) {
                                ++cmd;
                                --cmdlen;
                        } else if (isblank(ch))
@@ -309,7 +310,8 @@
                off = exp->argsoff;
                exp->args[off]->len = len;
                for (p = exp->args[off]->bp; len > 0; --len, *p++ = *ap++)
-                       if (*ap == '\\')
+                       if ((IS_ESCAPE(sp, excp, *ap) || *ap == '\\') &&
+                           len > 1)
                                ++ap;
                *p = '\0';
        }



Home | Main Index | Thread Index | Old Index