ls: fix segfault-if-standalone-shell, add big fat comment.
This commit is contained in:
@ -66,9 +66,9 @@ char get_header_ar(archive_handle_t *archive_handle)
|
|||||||
|
|
||||||
/* long filenames have '/' as the first character */
|
/* long filenames have '/' as the first character */
|
||||||
if (ar.formatted.name[0] == '/') {
|
if (ar.formatted.name[0] == '/') {
|
||||||
|
#if ENABLE_FEATURE_AR_LONG_FILENAMES
|
||||||
unsigned long_offset;
|
unsigned long_offset;
|
||||||
|
|
||||||
#if ENABLE_FEATURE_AR_LONG_FILENAMES
|
|
||||||
if (ar.formatted.name[1] == '/') {
|
if (ar.formatted.name[1] == '/') {
|
||||||
/* If the second char is a '/' then this entries data section
|
/* If the second char is a '/' then this entries data section
|
||||||
* stores long filename for multiple entries, they are stored
|
* stores long filename for multiple entries, they are stored
|
||||||
|
@ -777,6 +777,9 @@ static const unsigned opt_flags[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* 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);
|
||||||
int ls_main(int argc, char **argv)
|
int ls_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -797,8 +800,6 @@ int ls_main(int argc, char **argv)
|
|||||||
USE_FEATURE_AUTOWIDTH(char *terminal_width_str = NULL;)
|
USE_FEATURE_AUTOWIDTH(char *terminal_width_str = NULL;)
|
||||||
USE_FEATURE_LS_COLOR(char *color_opt;)
|
USE_FEATURE_LS_COLOR(char *color_opt;)
|
||||||
|
|
||||||
setvbuf(stdout, bb_common_bufsiz1, _IOFBF, BUFSIZ);
|
|
||||||
|
|
||||||
#if ENABLE_FEATURE_LS_TIMESTAMPS
|
#if ENABLE_FEATURE_LS_TIMESTAMPS
|
||||||
time(¤t_time_t);
|
time(¤t_time_t);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user