From d07cf59a98c0aa43cc546b667fb413ca4daab0c0 Mon Sep 17 00:00:00 2001
From: Eric Andersen <andersen@codepoet.org>
Date: Thu, 5 Feb 2004 13:52:03 +0000
Subject: Vladimir N. Oleynik writes:

Hi, Glenn.

Current CVS "ls" applet have small problem: some options
ignoring. Last patch attached ;-)


--w
vodz
---
 coreutils/ls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/coreutils/ls.c b/coreutils/ls.c
index 2f81ee05a..89e502115 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -938,6 +938,7 @@ static const unsigned opt_flags[] = {
 #ifdef CONFIG_SELINUX
 	LIST_MODEBITS|LIST_NLINKS|LIST_CONTEXT|LIST_SIZE|LIST_DATE_TIME, /* K */
 #endif
+	(1U<<31)
 };
 
 
@@ -1000,8 +1001,7 @@ extern int ls_main(int argc, char **argv)
 #else
 	opt = bb_getopt_ulflags(argc, argv, ls_options);
 #endif
-	/* 16 = maximum options minus tabsize and screewn width */
-	for (i = 0; i < 16; i++) {
+	for (i = 0; opt_flags[i] != (1U<<31); i++) {
 		if (opt & (1 << i)) {
 			unsigned int flags = opt_flags[i];
 			if (flags & LIST_MASK_TRIGGER) {
-- 
cgit v1.2.3-55-g6feb