home: environment-variables: Fix escaping.

* gnu/home/services.scm (environment-variable-shell-definitions): Fix
escaping.
* tests/guix-home.sh: Add STRING_WITH_ESCAPES environment variable and test
its value.

Reported-by: elevnkb
This commit is contained in:
Andrew Tropin 2023-01-09 12:22:56 +04:00
parent 2acce55a00
commit 35ecbb418c
No known key found for this signature in database
GPG key ID: 2208D20958C1DEB0
2 changed files with 6 additions and 3 deletions

View file

@ -192,7 +192,7 @@ ensures variable values are properly quoted."
(list->string (string-fold-right
(lambda (chr lst)
(if (memq chr quoted-chars)
(append (list chr #\\) lst)
(append (list #\\ chr) lst)
(cons chr lst)))
'()
value))))