svn commit: trunk/busybox: archival/libunarchive coreutils

vda at busybox.net vda at busybox.net
Mon Mar 19 20:59:21 UTC 2007


Author: vda
Date: 2007-03-19 13:59:20 -0700 (Mon, 19 Mar 2007)
New Revision: 18169

Log:
ls: fix segfault-if-standalone-shell, add big fat comment.


Modified:
   trunk/busybox/archival/libunarchive/get_header_ar.c
   trunk/busybox/coreutils/ls.c


Changeset:
Modified: trunk/busybox/archival/libunarchive/get_header_ar.c
===================================================================
--- trunk/busybox/archival/libunarchive/get_header_ar.c	2007-03-19 20:28:03 UTC (rev 18168)
+++ trunk/busybox/archival/libunarchive/get_header_ar.c	2007-03-19 20:59:20 UTC (rev 18169)
@@ -66,9 +66,9 @@
 
 	/* long filenames have '/' as the first character */
 	if (ar.formatted.name[0] == '/') {
+#if ENABLE_FEATURE_AR_LONG_FILENAMES
 		unsigned long_offset;
 
-#if ENABLE_FEATURE_AR_LONG_FILENAMES
 		if (ar.formatted.name[1] == '/') {
 			/* If the second char is a '/' then this entries data section
 			 * stores long filename for multiple entries, they are stored

Modified: trunk/busybox/coreutils/ls.c
===================================================================
--- trunk/busybox/coreutils/ls.c	2007-03-19 20:28:03 UTC (rev 18168)
+++ trunk/busybox/coreutils/ls.c	2007-03-19 20:59:20 UTC (rev 18169)
@@ -777,6 +777,9 @@
 };
 
 
+/* THIS IS A "SAFE" APPLET, main() MAY BE CALLED INTERNALLY FROM SHELL */
+/* BE CAREFUL! */
+
 int ls_main(int argc, char **argv);
 int ls_main(int argc, char **argv)
 {
@@ -797,8 +800,6 @@
 	USE_FEATURE_AUTOWIDTH(char *terminal_width_str = NULL;)
 	USE_FEATURE_LS_COLOR(char *color_opt;)
 
-	setvbuf(stdout, bb_common_bufsiz1, _IOFBF, BUFSIZ);
-
 #if ENABLE_FEATURE_LS_TIMESTAMPS
 	time(&current_time_t);
 #endif




More information about the busybox-cvs mailing list