about summary refs log tree commit diff
path: root/src/nix-env/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-10-14T15·09+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-10-14T15·09+0000
commitd830b2c1df3b80a1dffec40cbea8e9af7d0e0a11 (patch)
tree1c9f13421ba590a9d69f05ba8db07f874c65f1aa /src/nix-env/main.cc
parentfebd8bed1b341b56d58d43ebb09710504f997da9 (diff)
* In `nix-env -q', sort derivations by name *without* case
  sensitivity.

Diffstat (limited to 'src/nix-env/main.cc')
-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 cf4ac8fc4a7b..213082bdc7df 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);
 }