String value refactor

Related to https://github.com/NixOS/nix/pull/9047
This commit is contained in:
José Luis Lafuente 2023-11-28 15:05:04 +01:00 committed by José Luis Lafuente
parent c6e28d8da2
commit 550af113c6
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A

View file

@ -171,7 +171,7 @@ const char * nix_get_string(nix_c_context * context, const Value * value)
try {
auto & v = check_value_not_null(value);
assert(v.type() == nix::nString);
return v.string.s;
return v.c_str();
}
NIXC_CATCH_ERRS_NULL
}
@ -183,7 +183,7 @@ const char * nix_get_path_string(nix_c_context * context, const Value * value)
try {
auto & v = check_value_not_null(value);
assert(v.type() == nix::nPath);
return v._path;
return v.path().to_string().c_str();
}
NIXC_CATCH_ERRS_NULL
}