[BusyBox] Fix tab-tab listing of files so it properly reflectscurrent terminal width.

Vladimir N. Oleynik dzo at simtreas.ru
Tue Jan 14 05:02:03 UTC 2003


I wrote:

> > > I generated patch for correcting columns view for cmdedit.
> > > Added size +100 bytes compensated from "ls" applet -200 bytes and
> > > removing small bug for without autowidth (in "ls").
> > >
> >
> > Applied, i forgot to mention in the cvs entry that it was your patch.
> 
> Thanks!
> Can you modify stable branch?
> Erik patched bb-stable cmdedit for "correct columns", but I very like not
> this patch.
> Also, if you can patching stabble branch, you can look my patch
> for your maintaining gzip applet
> http://www.busybox.net/lists/busybox/2002-December/012899.html

"The one who of nothing does is not mistaken only."
Small correcting path for true work "ls -LC" now attached.


--w
vodz
-------------- next part --------------
diff -ru busybox.orig/fileutils/ls.c busybox/fileutils/ls.c
--- busybox.orig/fileutils/ls.c	Sun Jan  5 15:06:23 2003
+++ busybox/fileutils/ls.c	Tue Jan 14 00:50:54 2003
@@ -839,6 +839,7 @@
 		switch (opt) {
 		case '1':
 			style_fmt = STYLE_SINGLE;
+			list_fmt = LIST_SHORT;
 			break;
 		case 'A':
 			disp_opts |= DISP_HIDDEN;
@@ -848,6 +849,7 @@
 			break;
 		case 'C':
 			style_fmt = STYLE_COLUMNS;
+			list_fmt = LIST_SHORT;
 			break;
 		case 'd':
 			disp_opts |= DISP_NOLIST;
@@ -958,8 +960,8 @@
 	if (time_fmt & TIME_ACCESS)
 		sort_opts = SORT_ATIME;
 #endif
-	if (style_fmt != STYLE_LONG)
-		list_fmt &= ~LIST_ID_NUMERIC;   /* numeric uid only for long list */
+	if (style_fmt != STYLE_LONG) /* only for long list */
+		list_fmt &= ~(LIST_ID_NUMERIC|LIST_FULLTIME|LIST_ID_NAME|LIST_ID_NUMERIC);
 #ifdef CONFIG_FEATURE_LS_USERNAME
 	if (style_fmt == STYLE_LONG && (list_fmt & LIST_ID_NUMERIC))
 		list_fmt &= ~LIST_ID_NAME;      /* don't list names if numeric uid */


More information about the busybox mailing list