Skip to content
Tcl Source Code View Ticket
Login

View Ticket

registry package fail to get list of string of multi_sz type with empty string

Closed / Invalid91092e1fb5add2777133bce31283b29681fb3d75Created 10 years agoUpdated 42 days ago
Descriptionplain2016-10-28 10:22:32
'registry get' command cuts list of strings of multi_sz value just after first empty string in the list.

Test case:
% registry set "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager" TEST [list foo bar baz bla] multi_sz
% registry get "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager" TEST
foo bar baz bla
% registry set "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager" TEST [list foo bar "" baz bla] multi_sz
% registry get "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager" TEST
foo bar
%
jan.nijtmanswiki2016-10-28 11:09:09

See: https://msdn.microsoft.com/en-us/library/ff638335.aspx

So, the multi_sz type is defined by Windows as being terminated by an empty string. I don't have any idea how Tcl could possibly work around that, it's simply the way multi_sz works in Windows. Just as a terminating NULL character ends a C-string, there is no way to embed a NULL character in a C-string.

serhiy.storchakawiki2026-10-15 11:29:04

Closing: answered above.

serhiy.storchaka Ticket [91092e1fb5]: 3 changes [History diff]2026-10-22 17:19:26
Log in (anonymous is fine) to add a comment.