mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Windows Utf8 -> Wtf8
This commit is contained in:
@ -88,7 +88,7 @@ fn homeWindows(buf: []u8) !?[]u8 {
|
|||||||
const fba = fba_instance.allocator();
|
const fba = fba_instance.allocator();
|
||||||
const drive = std.process.getEnvVarOwned(fba, "HOMEDRIVE") catch |err| switch (err) {
|
const drive = std.process.getEnvVarOwned(fba, "HOMEDRIVE") catch |err| switch (err) {
|
||||||
error.OutOfMemory => return Error.BufferTooSmall,
|
error.OutOfMemory => return Error.BufferTooSmall,
|
||||||
error.InvalidUtf8, error.EnvironmentVariableNotFound => return null,
|
error.InvalidWtf8, error.EnvironmentVariableNotFound => return null,
|
||||||
};
|
};
|
||||||
// could shift the contents if this ever happens
|
// could shift the contents if this ever happens
|
||||||
if (drive.ptr != buf.ptr) @panic("codebug");
|
if (drive.ptr != buf.ptr) @panic("codebug");
|
||||||
@ -101,7 +101,7 @@ fn homeWindows(buf: []u8) !?[]u8 {
|
|||||||
const fba = fba_instance.allocator();
|
const fba = fba_instance.allocator();
|
||||||
const homepath = std.process.getEnvVarOwned(fba, "HOMEPATH") catch |err| switch (err) {
|
const homepath = std.process.getEnvVarOwned(fba, "HOMEPATH") catch |err| switch (err) {
|
||||||
error.OutOfMemory => return Error.BufferTooSmall,
|
error.OutOfMemory => return Error.BufferTooSmall,
|
||||||
error.InvalidUtf8, error.EnvironmentVariableNotFound => return null,
|
error.InvalidWtf8, error.EnvironmentVariableNotFound => return null,
|
||||||
};
|
};
|
||||||
// could shift the contents if this ever happens
|
// could shift the contents if this ever happens
|
||||||
if (homepath.ptr != path_buf.ptr) @panic("codebug");
|
if (homepath.ptr != path_buf.ptr) @panic("codebug");
|
||||||
|
Reference in New Issue
Block a user