diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2023-04-17 11:19:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 11:19:40 +0200 |
commit | 9af9c260fc0aff9e20a1c2e965249a20394ca22a (patch) | |
tree | 354d2c88676aa29f3a5fd18d4479e97655391c02 /src/libstore | |
parent | 36a473c5e80957fc0f2fd398cb75053f635e4524 (diff) | |
parent | b6125772d7d5f82d48873fc93a7f261832154b14 (diff) |
Merge pull request #8193 from hercules-ci/dry-strings
Deduplicate string literal rendering, fix 4909
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/derivations.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index abdfb1978..7eb5cd275 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; |