aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derivations.cc
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-04-09 22:42:20 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-04-09 22:42:20 +0200
commit4e0804c920558575a4b3486df1e595445bf67555 (patch)
tree9dbeb968bb9c3d4a1bc02b49ab2ff219f8e1f065 /src/libstore/derivations.cc
parent8f0ec323ea0cb4791ca8edfe122b0d7523acfc80 (diff)
Deduplicate string literal rendering, fix 4909
Diffstat (limited to 'src/libstore/derivations.cc')
-rw-r--r--src/libstore/derivations.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index abdfb1978..9948862e5 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -313,6 +313,15 @@ Derivation parseDerivation(const Store & store, std::string && s, std::string_vi
}
+/**
+ * Print a derivation string literal to an std::string.
+ *
+ * This syntax does not generalize to the expression language, which needs to
+ * escape `$`.
+ *
+ * @param res Where to print to
+ * @param s Which logical string to print
+ */
static void printString(std::string & res, std::string_view s)
{
boost::container::small_vector<char, 64 * 1024> buffer;