diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2007-04-02 18:27:34 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-04-02 18:29:41 +0200 |
commit | a3b65a63a0ecbd617f59572add0109e5e5944acf (patch) | |
tree | 27f1da6c06b5da20ec63d6040e02795f2570cff9 /src | |
parent | 0b39324840ff0e6dc9b5c1666658af67b8205849 (diff) | |
download | coreutils-a3b65a63a0ecbd617f59572add0109e5e5944acf.tar.xz |
* src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
ls -x DIR would sometimes output the wrong string in place of the
first entry.
* NEWS: Mention the bug fix.
* tests/ls/x-option: New file.
* tests/ls/Makefile.am (TESTS): Add x-option.
Diffstat (limited to 'src')
-rw-r--r-- | src/ls.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4074,16 +4074,16 @@ print_horizontal (void) size_t pos = 0; size_t cols = calculate_columns (false); struct column_info const *line_fmt = &column_info[cols - 1]; - size_t name_length = length_of_file_name_and_frills (cwd_file); + struct fileinfo const *f = sorted_file[0]; + size_t name_length = length_of_file_name_and_frills (f); size_t max_name_length = line_fmt->col_arr[0]; /* Print first entry. */ - print_file_name_and_frills (cwd_file); + print_file_name_and_frills (f); /* Now the rest. */ for (filesno = 1; filesno < cwd_n_used; ++filesno) { - struct fileinfo const *f; size_t col = filesno % cols; if (col == 0) |