[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] fix broken set [+-]o output
From:       Martijn Dekker <martijn () inlv ! org>
Date:       2019-07-24 16:00:10
Message-ID: cb0c3a41-ed65-bff8-b601-330bdfe67230 () inlv ! org
[Download RAW message or body]

Commit f3634584 introduced short-form shell options without long-form 
equivalents. This broke the output of 'set -o' and 'set +o' as the 
function writing this output assumed all options have long names. This 
simple patch removes that assumption.

-- 
modernish -- harness the shell
https://github.com/modernish/modernish

["set-plusminus-o.patch" (text/plain)]

diff --git a/shell/ash.c b/shell/ash.c
index e3bbac9a0..625288770 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11091,6 +11091,8 @@ plus_minus_o(char *name, int val)
 		return 1;
 	}
 	for (i = 0; i < NOPTS; i++) {
+		if (optnames(i)[0] == '\0')
+			continue;
 		if (val) {
 			out1fmt("%-16s%s\n", optnames(i), optlist[i] ? "on" : "off");
 		} else {


_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic