Opened 8 years ago

Closed 8 years ago

#8071 closed bug (fixed)

ls bug compairing filenames with certain chars

Reported by: ribbonz Owned by: nobody
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/alpha3
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: x86

Description

This is probably just an ls bug, but I'm adding a ticket just in case.

Here's the output from Terminal that gives a simple way to produce the error:

~> mkdir tmp
~> cd tmp
~/tmp> touch 'Efigênia'
~/tmp> ll
total 2
-rw-r--r-- 1 user root 0 Oct 30 12:50 Efigênia
~/tmp> touch abc
~/tmp> ll
ls: cannot compare file names 'Efig\303\252nia' and 'abc': Invalid Argument
total 4
-rw-r--r-- 1 user root 0 Oct 30 12:50 Efigênia
-rw-r--r-- 1 user root 0 Oct 30 12:51 abc
~/tmp> ls --version
ls (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.
~/tmp> uname -a
Haiku shredder 1 42211 Jun 18 2011 08:26:42 BePC Haiku
~/tmp>

The "cannot compare file names..." error message came up after I had downloaded a jpeg file that had 'Efigênia' as part of the name.

I'm using a stock alpha3. I don't know if coreutils has been updated since then (I'm guessing not).

Change History (4)

comment:1 by anevilyak, 8 years ago

Component: - GeneralApplications/Command Line Tools

What locale are you set to?

comment:2 by ribbonz, 8 years ago

What locale? Um... the regular one, I guess. I haven't changed anything.

Preferences::Locale app shows "English" in the Language tab, and "English (United States)" in the Formatting tab. Which works for me, because I speak English and live in the United States. :)

comment:3 by deejam, 8 years ago

There are several similar tickets (#6263, #7700, #7853) which may have the same cause. So this might be a duplicate.

comment:4 by anevilyak, 8 years ago

Resolution: fixed
Status: newclosed

This is indeed a bug in ls ; if the locale isn't set, it defaults to the POSIX locale and doesn't correctly handle anything non-ascii. This doesn't occur on newer revisions though since we now explicitly set the LC_* variables, which makes things behave a bit better.

Note: See TracTickets for help on using tickets.