Re: [coreutils] [PATCH] sort: fix --debug display with very large offsets

2010-07-27 Thread Pádraig Brady
On 27/07/10 19:03, Paul Eggert wrote: > * src/sort.c (mark_key): Don't assume offset <= INT_MAX. > Make the code a bit clearer when width != 0. That's better, though good luck to people trying to debug > 32K character lines :) The common case is for offsets < 100 and we don't care too much about d

Re: [coreutils] [PATCH] sort: fix --debug display with very large offsets

2010-07-27 Thread Paul Eggert
On 07/27/10 13:29, Eric Blake wrote: > I'd rather see something along the lines of: > > while (INT_MAX < offset) > { > printf ("%*s", INT_MAX, ""); > offset -= INT_MAX; > } > printf ("%*s", (int) offset), ""); That'd be fine too. It's only used during debugging, and there is a simil

Re: [coreutils] [PATCH] sort: fix --debug display with very large offsets

2010-07-27 Thread Eric Blake
On 07/27/2010 12:03 PM, Paul Eggert wrote: > * src/sort.c (mark_key): Don't assume offset <= INT_MAX. > Make the code a bit clearer when width != 0. > --- > src/sort.c |7 +-- > 1 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/src/sort.c b/src/sort.c > index 588bae8..f552

[coreutils] [PATCH] sort: fix --debug display with very large offsets

2010-07-27 Thread Paul Eggert
* src/sort.c (mark_key): Don't assume offset <= INT_MAX. Make the code a bit clearer when width != 0. --- src/sort.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sort.c b/src/sort.c index 588bae8..f552d21 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2162,14 +2

Re: [coreutils] How to figure out all the hard links that link to the same file?

2010-07-27 Thread Pádraig Brady
On 27/07/10 13:01, Eric Blake wrote: > On 07/27/2010 01:30 AM, wayana wrote: >> Hello, >> >> How about using 'find' ? >> >> $ find -inum $(ls -i a | cut -d ' ' -f 1) >> ./b >> ./a > > That assumes they are in the same directory. But in reality, the other > link can be anywhere within the same dev

Re: [coreutils] How to figure out all the hard links that link to the same file?

2010-07-27 Thread Eric Blake
On 07/27/2010 01:30 AM, wayana wrote: > Hello, > > How about using 'find' ? > > $ find -inum $(ls -i a | cut -d ' ' -f 1) > ./b > ./a That assumes they are in the same directory. But in reality, the other link can be anywhere within the same device, so you need to figure out where the mount poi

Re: [coreutils] [PATCH] sort: fix bug with EOF at buffer refill

2010-07-27 Thread Pádraig Brady
On 27/07/10 04:53, Paul Eggert wrote: > * src/sort.c (fillbuf): Don't append eol unless the line is nonempty. > This fixes a bug that was partly but not completely fixed by > the aadc67dfdb47f28bb8d1fa5e0fe0f52e2a8c51bf commit (dated July 15). > * tests/misc/sort (realloc-buf-2): New test, which ca

Re: [coreutils] How to figure out all the hard links that link to the same file?

2010-07-27 Thread wayana
Hello, How about using 'find' ? $ find -inum $(ls -i a | cut -d ' ' -f 1) ./b ./a On Tue, Jul 27, 2010 at 5:35 AM, Peng Yu wrote: > Hi, > > If I inspect the results from 'stat', I know that the file 'a' and 'b' > are the same. But if I only know 'a', is there a way to figure out > that what