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/8af22734face
branches:  netbsd-3
changeset: 577139:8af22734face
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Sep 09 15:01:44 2005 +0000

description:
Pull up following revision(s) (requested by aymeric in ticket #753):
        usr.bin/vi/ex/ex_argv.c: revision 1.14
In argv_exp3() where we cut a line into args, check for '\' as the escape
character instead of using the IS_ESCAPE() macro which tests for ^V because the
former is mandated by the standards, and the latter is insane.
This is a very small part in addressing PR bin/26046 by lukem@.
Before, in order to escape a special character, you had to use a literal ^V,
which is type ^V twice before the character; whereas now, you use \.
Because the fix will remain partial for a while, you have to remove \ from
your shellmeta option otherwise the \ is swallowed by the invoked shell that
handles arguments expansion.
Please complain if you want ^V^V to also work, but please don't call me a
heretic.

diffstat:

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

diffs (36 lines):

diff -r 5fe55bfd2018 -r 8af22734face usr.bin/vi/ex/ex_argv.c
--- a/usr.bin/vi/ex/ex_argv.c   Fri Sep 09 15:00:58 2005 +0000
+++ b/usr.bin/vi/ex/ex_argv.c   Fri Sep 09 15:01:44 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ex_argv.c,v 1.12.2.1 2005/09/09 15:00:58 tron Exp $    */
+/*     $NetBSD: ex_argv.c,v 1.12.2.2 2005/09/09 15:01:44 tron 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.1 2005/09/09 15:00:58 tron Exp $");
+__RCSID("$NetBSD: ex_argv.c,v 1.12.2.2 2005/09/09 15:01:44 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -291,7 +291,7 @@
                 */
                for (ap = cmd, len = 0; cmdlen > 0; ++cmd, --cmdlen, ++len) {
                        ch = *cmd;
-                       if (IS_ESCAPE(sp, excp, ch) && cmdlen > 1) {
+                       if (ch == '\\' && cmdlen > 1) {
                                ++cmd;
                                --cmdlen;
                        } else if (isblank(ch))
@@ -309,7 +309,7 @@
                off = exp->argsoff;
                exp->args[off]->len = len;
                for (p = exp->args[off]->bp; len > 0; --len, *p++ = *ap++)
-                       if (IS_ESCAPE(sp, excp, *ap))
+                       if (*ap == '\\')
                                ++ap;
                *p = '\0';
        }



Home | Main Index | Thread Index | Old Index