>From 085cd4f456fd1d3a6a0de4d45690921e40ea4be0 Mon Sep 17 00:00:00 2001
Message-Id: 
<085cd4f456fd1d3a6a0de4d45690921e40ea4be0.1436133857.git.jacob.wahlg...@gmail.com>
From: Jacob Wahlgren <[email protected]>
Date: Sun, 5 Jul 2015 23:53:00 +0200
Subject: [PATCH] Fix vi set with multiple arguments (bug 4207)

>These work:
>vi -c"set noshowmatch" -c"set tabstop=2"
>vi -c"set tabstop=2" -c"set noshowmatch"
>vi -c "set tabstop=2 noshowmatch"
>
>This will change noshowmatch but NOT change the tabstop=2:
>vi -c "set noshowmatch tabstop=2"

diff --git a/editors/vi.c b/editors/vi.c
index 6ce513c..71dbbc6 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1358,7 +1358,6 @@ static void colon(char *buf)
 #if ENABLE_FEATURE_VI_SETOPTS
         char *argp;
 #endif
-        i = 0;            // offset into args
         // only blank is regarded as args delimiter. What about tab '\t'?
         if (!args[0] || strcasecmp(args, "all") == 0) {
             // print out values of all options
@@ -1383,6 +1382,8 @@ static void colon(char *buf)
         while (*argp) {
             if (strncmp(argp, "no", 2) == 0)
                 i = 2;        // ":set noautoindent"
+            else
+                i = 0;
             setops(argp, "autoindent ", i, "ai", VI_AUTOINDENT);
             setops(argp, "flash "     , i, "fl", VI_ERR_METHOD);
             setops(argp, "ignorecase ", i, "ic", VI_IGNORECASE);
-- 
1.9.1
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to