diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml
index 9517f2010..063bc04be 100644
--- a/doc/manual/expressions/builtins.xml
+++ b/doc/manual/expressions/builtins.xml
@@ -210,6 +210,35 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
+ builtins.match
+ regex str
+
+ Returns a list if
+ regex matches
+ str precisely, otherwise returns null.
+ Each item in the list is a regex group.
+
+
+builtins.match "ab" "abc"
+
+
+Evaluates to null.
+
+
+builtins.match "abc" "abc"
+
+
+Evaluates to [ ].
+
+
+builtins.match "a(b)(c)" "abc"
+
+
+Evaluates to [ "b" "c" ].
+
+
+
+
builtins.elem
x xs
diff --git a/doc/manual/expressions/language-values.xml b/doc/manual/expressions/language-values.xml
index b90baac50..67da688a4 100644
--- a/doc/manual/expressions/language-values.xml
+++ b/doc/manual/expressions/language-values.xml
@@ -167,7 +167,16 @@ stdenv.mkDerivation {
user's home directory. e.g. ~/foo would be
equivalent to /home/edolstra/foo for a user
whose home directory is /home/edolstra.
-
+
+
+ Paths can also be specified between angle brackets, e.g.
+ <nixpkgs>. This means that the directories
+ listed in the environment variable
+ NIX_PATH will be searched
+ for the given file or directory name.
+
+
+
Booleans with values
true and
diff --git a/shell.nix b/shell.nix
index 1a6ec6b88..7e945023e 100644
--- a/shell.nix
+++ b/shell.nix
@@ -14,6 +14,7 @@ stdenv.mkDerivation {
customMemoryManagement = false;
})
autoreconfHook
+ perlPackages.DBDSQLite
];
configureFlags =
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 81aced0fd..aa50fceb9 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -165,7 +165,13 @@ Hash parseHash32(HashType ht, const string & s)
unsigned int i = b / 8;
unsigned int j = b % 8;
hash.hash[i] |= digit << j;
- if (i < hash.hashSize - 1) hash.hash[i + 1] |= digit >> (8 - j);
+
+ if (i < hash.hashSize - 1) {
+ hash.hash[i + 1] |= digit >> (8 - j);
+ } else {
+ if (digit >> (8 - j))
+ throw BadHash(format("invalid base-32 hash ‘%1%’") % s);
+ }
}
return hash;