[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in ls -1U: argument files printed after their contents
From: |
Kamil Dudka |
Subject: |
Re: bug in ls -1U: argument files printed after their contents |
Date: |
Sat, 25 Jul 2009 00:12:55 +0200 |
User-agent: |
KMail/1.9.7 |
On Friday 24 of July 2009 21:49:35 Julian Bradfield wrote:
> This hit me with the RH EL5 package coreutils-5.97-19.el5 .
> I also see it in a build from clean coreutils-7.4 GNU release.
>
> Problem: when printing files with the -1U options, and more than one
> file is given on the command line, the argument files are printed
> after their contents instead of before.
>
> Transcript demonstrating bug:
> -------------------------------------------
> krk: mkdir /tmp/LSBUG
> krk: mkdir /tmp/LSBUG/a
> krk: mkdir /tmp/LSBUG/b
> krk: touch /tmp/LSBUG/a/1
> krk: /bin/ls -1U /tmp/LSBUG/a /tmp/LSBUG/b
> 1
> /tmp/LSBUG/a:
>
> /tmp/LSBUG/b:
> krk:
> -------------------------------------------
>
> Of course, this breaks any script that relies on that format, as well
> as baffling human users. Since this bug doesn't seem to have been
> reported yet, I guess I must be the only person left on the planet
> running a 15-year old Cnews suite, where the expire script relies on
> it and completely breaks.
>
> Since I see it in RH 5.97-19, which includes the "lsmemoryexhausted"
> patch:
> author Kamil Dudka <address@hidden> 2008-07-30 12:31:50 (GMT)
> committer Jim Meyering <address@hidden> 2008-08-01 06:36:38
> (GMT) commit 8d974b00fbbc2025de63e1e6d54827648fefa1c4 (patch)
> tree bff56540d745da7ec4287455eaf3ad119bae5441
> parent b44f5f74aa1cb209720cbb2cd60ecd47975397ab (diff)
>
> and I don't see in GNU 6.12, which doesn't include that patch, and I
> do see it in GNU 7.4, which does, and the patch is obviously relevant,
> I blame that patch.
I agree. It behaves a bit different than we would expect to. Generally we have
two possible solutions. We can either turn the optimization off when there
are more than one files given as ls' argument. Or we can make it working even
in that case. I'll look at it next week.
> I don't have a fix.
If you're in hurry, 'patch -R' might be good enough fix (to turn
the optimization off).
Kamil