[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why doesn't ls use fnmatch() when matching against extensions in $LS_COL
From: |
Nikolai Weibull |
Subject: |
Why doesn't ls use fnmatch() when matching against extensions in $LS_COLORS? |
Date: |
Thu, 6 Jul 2006 17:11:09 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
The test that ls employs for determining if a file should be given some certain
kind of highlighting when listed currently uses strncmp() to compare the last
few characters of a file's name against the extensions found in $LS_COLORS.
Why is fnmatch() not being used to do this test? As it is now, the '*' can only
be given as a prefix and is just part of a big charade.
It also makes matching things like *.r[0-9][0-9] for parts in a rar-archive set
impossible without listing them explicitly in your dircolors file.
I assume that there is some higher reason for this, as a patch to use fnmatch()
instead of strncmp() is incredibly trivial, but I fail to see what it is.
Thanks.
nikolai
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Why doesn't ls use fnmatch() when matching against extensions in $LS_COLORS?,
Nikolai Weibull <=