Tizen 2.0 Release
[external/tizen-coreutils.git] / packaging / coreutils-ls-x.patch
1 --- coreutils-6.9/src/ls.c.ls-x 2007-06-13 14:27:36.000000000 +0100
2 +++ coreutils-6.9/src/ls.c      2007-06-13 14:28:42.000000000 +0100
3 @@ -4151,16 +4151,16 @@
4    size_t pos = 0;
5    size_t cols = calculate_columns (false);
6    struct column_info const *line_fmt = &column_info[cols - 1];
7 -  size_t name_length = length_of_file_name_and_frills (cwd_file);
8 +  struct fileinfo const *f = sorted_file[0];
9 +  size_t name_length = length_of_file_name_and_frills (f);
10    size_t max_name_length = line_fmt->col_arr[0];
11  
12    /* Print first entry.  */
13 -  print_file_name_and_frills (cwd_file);
14 +  print_file_name_and_frills (f);
15  
16    /* Now the rest.  */
17    for (filesno = 1; filesno < cwd_n_used; ++filesno)
18      {
19 -      struct fileinfo const *f;
20        size_t col = filesno % cols;
21  
22        if (col == 0)
23 --- coreutils-6.9/tests/ls/Makefile.am.ls-x     2007-03-18 21:36:43.000000000 +0000
24 +++ coreutils-6.9/tests/ls/Makefile.am  2007-06-13 14:28:42.000000000 +0100
25 @@ -24,7 +24,7 @@
26    stat-dtype \
27    inode dangle file-type recursive dired infloop \
28    rt-1 time-1 symlink-slash follow-slink no-arg m-option \
29 -  stat-vs-dirent
30 +  stat-vs-dirent x-option
31  
32  EXTRA_DIST = $(TESTS)
33  TESTS_ENVIRONMENT = \
34 --- /dev/null   2007-06-13 08:43:51.993263382 +0100
35 +++ coreutils-6.9/tests/ls/x-option     2007-06-13 14:28:42.000000000 +0100
36 @@ -0,0 +1,59 @@
37 +#!/bin/sh
38 +# Exercise the -x option.
39 +
40 +# Copyright (C) 2007 Free Software Foundation, Inc.
41 +
42 +# This program is free software; you can redistribute it and/or modify
43 +# it under the terms of the GNU General Public License as published by
44 +# the Free Software Foundation; either version 2 of the License, or
45 +# (at your option) any later version.
46 +
47 +# This program is distributed in the hope that it will be useful,
48 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
49 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50 +# GNU General Public License for more details.
51 +
52 +# You should have received a copy of the GNU General Public License
53 +# along with this program; if not, write to the Free Software
54 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
55 +# 02110-1301, USA.
56 +
57 +if test "$VERBOSE" = yes; then
58 +  set -x
59 +  ls --version
60 +fi
61 +
62 +. $srcdir/../envvar-check
63 +. $srcdir/../lang-default
64 +
65 +pwd=`pwd`
66 +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
67 +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
68 +trap '(exit $?); exit $?' 1 2 13 15
69 +
70 +framework_failure=0
71 +mkdir -p $tmp || framework_failure=1
72 +cd $tmp || framework_failure=1
73 +mkdir subdir || framework_failure=1
74 +touch subdir/b || framework_failure=1
75 +touch subdir/a || framework_failure=1
76 +
77 +if test $framework_failure = 1; then
78 +  echo "$0: failure in testing framework" 1>&2
79 +  (exit 1); exit 1
80 +fi
81 +
82 +fail=0
83 +
84 +# Coreutils 6.8 and 6.9 would output this in the wrong order.
85 +ls -x subdir > out || fail=1
86 +ls -rx subdir >> out || fail=1
87 +cat <<\EOF > exp || fail=1
88 +a  b
89 +b  a
90 +EOF
91 +
92 +cmp out exp || fail=1
93 +test $fail = 1 && diff out exp 2> /dev/null
94 +
95 +(exit $fail); exit $fail
96 --- coreutils-6.9/NEWS.ls-x     2007-03-22 21:19:45.000000000 +0000
97 +++ coreutils-6.9/NEWS  2007-06-13 14:28:42.000000000 +0100
98 @@ -13,6 +13,11 @@
99    Using pr -m -s (i.e. merging files, with TAB as the output separator)
100    no longer inserts extraneous spaces between output columns.
101  
102 +** Bug fixes
103 +
104 +  ls -x DIR would sometimes output the wrong string in place of the
105 +  first entry.  [introduced in coreutils-6.8]
106 +
107  
108  * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
109