lib.gvariant: escape backslashes in strings

PR #1433
wip/yesman
Symphorien Gibol 4 years ago committed by Robert Helgesson
parent d1f4d1514d
commit e1fbb74b41
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
  1. 2
      modules/lib/gvariant.nix
  2. 2
      tests/lib/types/gvariant-merge.nix

@ -123,7 +123,7 @@ in rec {
mkString = v:
mkPrimitive type.string v // {
__toString = self: "'${escape [ "'" ] self.value}'";
__toString = self: "'${escape [ "'" "\\" ] self.value}'";
};
mkObjectpath = v:

@ -26,6 +26,7 @@ in {
{ string = "foo"; }
{ string = "foo"; }
{ escapedString = "' \\"; }
{ tuple = mkTuple [ 1 [ "foo" ] ]; }
@ -46,6 +47,7 @@ in {
bool = true
emptyArray1 = @as []
emptyArray2 = @as []
escapedString = '\' \\'
float = 3.140000
int = 42
list = @as ['one','two']

Loading…
Cancel
Save