Use newlines as separator for paths, not null chars

This commit is contained in:
Max Brunsfeld 2025-08-25 16:51:42 -07:00
parent 25d8e9bc75
commit d58a0f459e
2 changed files with 6 additions and 5 deletions

View file

@ -58,7 +58,7 @@ impl PathList {
let mut paths: Vec<PathBuf> = if serialized.paths.is_empty() {
Vec::new()
} else {
serialized.paths.split('\0').map(PathBuf::from).collect()
serialized.paths.split('\n').map(PathBuf::from).collect()
};
let mut order: Vec<usize> = serialized
@ -84,7 +84,7 @@ impl PathList {
let mut paths = String::new();
for path in self.paths.iter() {
if !paths.is_empty() {
paths.push('\0');
paths.push('\n');
}
paths.push_str(&path.to_string_lossy());
}

View file

@ -553,7 +553,7 @@ impl Domain for WorkspaceDb {
WHEN workspaces.local_paths_array IS NULL OR workspaces.local_paths_array = "" THEN
NULL
ELSE
replace(workspaces.local_paths_array, ',', '\0')
replace(workspaces.local_paths_array, ',', "\n")
END
END as paths,
@ -613,11 +613,12 @@ impl Domain for WorkspaceDb {
replace(
substr(paths, 3, length(paths) - 4),
'"' || ',' || '"',
'\0'
CHAR(10)
)
ELSE
replace(paths, ',', '\0')
replace(paths, ',', CHAR(10))
END
WHERE paths IS NOT NULL
),
];