From d830b2c1df3b80a1dffec40cbea8e9af7d0e0a11 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 14 Oct 2004 15:09:55 +0000 Subject: * In `nix-env -q', sort derivations by name *without* case sensitivity. --- src/nix-env/main.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index cf4ac8fc4..213082bdc 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -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); } -- cgit v1.2.3