aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-10-14 15:09:55 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-10-14 15:09:55 +0000
commitd830b2c1df3b80a1dffec40cbea8e9af7d0e0a11 (patch)
tree1c9f13421ba590a9d69f05ba8db07f874c65f1aa /src
parentfebd8bed1b341b56d58d43ebb09710504f997da9 (diff)
* In `nix-env -q', sort derivations by name *without* case
sensitivity.
Diffstat (limited to 'src')
-rw-r--r--src/nix-env/main.cc10
1 files changed, 9 insertions, 1 deletions
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);
}