[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: home: environment-variables: Fix escaping.
From: |
guix-commits |
Subject: |
branch master updated: home: environment-variables: Fix escaping. |
Date: |
Mon, 09 Jan 2023 03:58:25 -0500 |
This is an automated email from the git hooks/post-receive script.
abcdw pushed a commit to branch master
in repository guix.
The following commit(s) were added to refs/heads/master by this push:
new 35ecbb418c home: environment-variables: Fix escaping.
35ecbb418c is described below
commit 35ecbb418c03e3957ebab87af921742466fe2de9
Author: Andrew Tropin <andrew@trop.in>
AuthorDate: Mon Jan 9 12:22:56 2023 +0400
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
---
gnu/home/services.scm | 2 +-
tests/guix-home.sh | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index c442da374c..b17a34d19d 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -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))))
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index 83ca6e72c8..3151f66683 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -84,8 +84,9 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf
"$test_directory"' EXIT
home-environment-variables-service-type
`(("TODAY" . "26 messidor")
("SHELL" . ,(file-append bash "/bin/bash"))
- ("BUILDHOSTTIME" . ,#~(strftime "%c"
- (localtime (current-time))))
+ ("BUILDHOST_TIME" . ,#~(strftime "%c"
+ (localtime (current-time))))
+ ("STRING_WITH_ESCAPES" . "chars: \" /\\")
("LITERAL" . ,(literal-string "${abc}"))))
(simple-service 'home-bash-service-extension-test
@@ -156,6 +157,8 @@ EOF
( . "${HOME}/.guix-home/setup-environment"; test "$TODAY" = "26 messidor" )
( . "${HOME}/.guix-home/setup-environment"; test "$LITERAL" = '${abc}' )
+ ( . "${HOME}/.guix-home/setup-environment";
+ test "$STRING_WITH_ESCAPES" = "chars: \" /\\")
( . "${HOME}/.guix-home/setup-environment";
echo "$SHELL" | grep "/gnu/store/.*/bin/bash" )
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: home: environment-variables: Fix escaping.,
guix-commits <=