* In `nix-env -q', sort derivations by name *without* case

sensitivity.
This commit is contained in:
Eelco Dolstra 2004-10-14 15:09:55 +00:00
parent febd8bed1b
commit d830b2c1df

View file

@ -465,9 +465,17 @@ static void opUninstall(Globals & globals,
}
static bool cmpChars(char a, char b)
{
return toupper(a) < toupper(b);
}
static bool cmpDrvByName(const DrvInfo & a, const DrvInfo & b)
{
return a.name < b.name;
return lexicographical_compare(
a.name.begin(), a.name.end(),
b.name.begin(), b.name.end(), cmpChars);
}