import local busybox-power tree (1.18.5power2)
[busybox-power] / debian / patches / obselete / ls-s-dont-follow-links.patch
1 From 2089b4bf5880f49e8185b2e07966714a9ce9dcd5 Mon Sep 17 00:00:00 2001
2 From: Alexander Shishkin <ext-alexander.shishkin@nokia.com>
3 Date: Fri, 12 Jun 2009 14:43:26 +0300
4 Subject: [PATCH] Don't follow symlinks for -l or -s in ls. Fixes: NB#120999.
5
6 Signed-off-by: Alexander Shishkin <ext-alexander.shishkin@nokia.com>
7 ---
8  coreutils/ls.c |    4 ++--
9  1 files changed, 2 insertions(+), 2 deletions(-)
10
11 diff --git a/coreutils/ls.c b/coreutils/ls.c
12 index 9e5c6de..e06f0eb 100644
13 --- a/coreutils/ls.c
14 +++ b/coreutils/ls.c
15 @@ -908,8 +908,8 @@ int ls_main(int argc, char **argv)
16         /* stuff the command line file names into a dnode array */
17         dn = NULL;
18         for (oi = 0; oi < ac; oi++) {
19 -               /* ls w/o -l follows links on command line */
20 -               cur = my_stat(av[oi], av[oi], !(all_fmt & STYLE_LONG));
21 +               /* NB: follow links on command line unless -l or -s */
22 +               cur = my_stat(av[oi], av[oi], !(all_fmt & (STYLE_LONG|LIST_BLOCKS)));
23                 if (!cur)
24                         continue;
25                 cur->allocated = 0;
26 -- 
27 1.6.3.1
28