aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-03-19 20:59:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-03-19 20:59:20 +0000
commit97fd6d81b4f101a32c31c4711fb43d0f5c78c47b (patch)
tree19b05ece7934d71f90b490cff52fdceb39e62f92
parent6111a8f2e737fea9147cb3fb21613d32d34788bd (diff)
downloadbusybox-w32-97fd6d81b4f101a32c31c4711fb43d0f5c78c47b.tar.gz
busybox-w32-97fd6d81b4f101a32c31c4711fb43d0f5c78c47b.tar.bz2
busybox-w32-97fd6d81b4f101a32c31c4711fb43d0f5c78c47b.zip
ls: fix segfault-if-standalone-shell, add big fat comment.
-rw-r--r--archival/libunarchive/get_header_ar.c2
-rw-r--r--coreutils/ls.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c
index a8a595e08..c691f1b2f 100644
--- a/archival/libunarchive/get_header_ar.c
+++ b/archival/libunarchive/get_header_ar.c
@@ -66,9 +66,9 @@ char get_header_ar(archive_handle_t *archive_handle)
66 66
67 /* long filenames have '/' as the first character */ 67 /* long filenames have '/' as the first character */
68 if (ar.formatted.name[0] == '/') { 68 if (ar.formatted.name[0] == '/') {
69#if ENABLE_FEATURE_AR_LONG_FILENAMES
69 unsigned long_offset; 70 unsigned long_offset;
70 71
71#if ENABLE_FEATURE_AR_LONG_FILENAMES
72 if (ar.formatted.name[1] == '/') { 72 if (ar.formatted.name[1] == '/') {
73 /* If the second char is a '/' then this entries data section 73 /* If the second char is a '/' then this entries data section
74 * stores long filename for multiple entries, they are stored 74 * stores long filename for multiple entries, they are stored
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 1c1544a34..2e68eb848 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -777,6 +777,9 @@ static const unsigned opt_flags[] = {
777}; 777};
778 778
779 779
780/* THIS IS A "SAFE" APPLET, main() MAY BE CALLED INTERNALLY FROM SHELL */
781/* BE CAREFUL! */
782
780int ls_main(int argc, char **argv); 783int ls_main(int argc, char **argv);
781int ls_main(int argc, char **argv) 784int ls_main(int argc, char **argv)
782{ 785{
@@ -797,8 +800,6 @@ int ls_main(int argc, char **argv)
797 USE_FEATURE_AUTOWIDTH(char *terminal_width_str = NULL;) 800 USE_FEATURE_AUTOWIDTH(char *terminal_width_str = NULL;)
798 USE_FEATURE_LS_COLOR(char *color_opt;) 801 USE_FEATURE_LS_COLOR(char *color_opt;)
799 802
800 setvbuf(stdout, bb_common_bufsiz1, _IOFBF, BUFSIZ);
801
802#if ENABLE_FEATURE_LS_TIMESTAMPS 803#if ENABLE_FEATURE_LS_TIMESTAMPS
803 time(&current_time_t); 804 time(&current_time_t);
804#endif 805#endif