In article <[EMAIL PROTECTED]>, Miles Bader 
<[EMAIL PROTECTED]> writes:
> Hmm, it actually seems to be a bug with `ls'!

> I created two files, one called `abc\ndef' (where \n is a newline), and
> one called `1234567'.  Here's what ls prints if stdout is a tty (I've
> indented the output by 3 spaces):

>    (tmp) LANG=ja_JP.eucJP ls -l --dired abc* 123*
>      -rw-rw----    1 miles           6 2003-01-27 13:03 1234567
>      -rw-rw----    1 miles           6 2003-01-27 12:58 abc?def
>    //DIRED// 53 60 114 121
>    //DIRED-OPTIONS// --quoting-style=literal

> [note that the start/end offsets of each filename differ by 7]

> But here's what the _same_ command prints if stdout is a pipe (which I
> presume is the case for dired):

>    (tmp) LANG=ja_JP.eucJP ls -l --dired abc* 123* | cat
>      -rw-rw----    1 miles           6 2003-01-27 13:03 1234567
>      -rw-rw----    1 miles           6 2003-01-27 12:58 abc
>    def
>    //DIRED// 53 60 114 120
>    //DIRED-OPTIONS// --quoting-style=literal

> Now the start/end offsets of `abc\ndef' now only differ by 6 (which is
> obviously wrong, since the filename is 7 characters long)!  Morever
> this problem only seems to occur if LANG=ja_JP.eucJP, _not_ if LANG=C.

> My ls --version says:  ls (coreutils) 4.5.4
> What version do you have?

Mine is "ls (fileutils) 4.1", and that works correctly even
if the stdout is a pile in any locales as below.

[~/tmp:709] LANG=ja_JP.eucJP \ls -l --dired abc* 123*|cat
  -rw-rw-r--    1 handa    handa           6 Jan 27 13:50 1234567
  -rw-rw-r--    1 handa    handa           6 Jan 27 13:51 abc
def
//DIRED// 58 65 124 131
//DIRED-OPTIONS// --quoting-style=(null)
[~/tmp:710] LANG=de_DE \ls -l --dired abc* 123*|cat
  -rw-rw-r--    1 handa    handa           6 Jan 27 13:50 1234567
  -rw-rw-r--    1 handa    handa           6 Jan 27 13:51 abc
def
//DIRED// 58 65 124 131
//DIRED-OPTIONS// --quoting-style=(null)
[~/tmp:711] LANG=C \ls -l --dired abc* 123*|cat
  -rw-rw-r--    1 handa    handa           6 Jan 27 13:50 1234567
  -rw-rw-r--    1 handa    handa           6 Jan 27 13:51 abc
def
//DIRED// 58 65 124 131
//DIRED-OPTIONS// --quoting-style=(null)

The difference with your case is in --quoting-style, I don't
know that meaning.

---
Ken'ichi HANDA
[EMAIL PROTECTED]


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to