Skip to content

Commit e3a4f5a

Browse files
authored
Merge pull request #7 from BlockProject3D/develop
bp3d-os release 2.2.1
2 parents 1dbd4bb + e9c9284 commit e3a4f5a

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bp3d-os"
3-
version = "2.2.0"
3+
version = "2.2.1"
44
authors = ["Yuri Edward <[email protected]>"]
55
edition = "2021"
66
description = "Operating System tools designed for BlockProject3D"

core/src/assets/apple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ pub fn get_exe_path() -> Option<PathBuf> {
5353
return None;
5454
}
5555
let str = OsStr::from_bytes(std::mem::transmute(&v[..size as usize]));
56-
return Some(PathBuf::from(str));
56+
return PathBuf::from(str).parent().map(|v| v.into());
5757
}
5858
if res != 0 {
5959
return None;
6060
}
6161
let len = strlen(buf.as_ptr());
6262
let str = OsStr::from_bytes(std::mem::transmute(&buf[..len]));
63-
Some(PathBuf::from(str))
63+
PathBuf::from(str).parent().map(|v| v.into())
6464
}
6565
}
6666

core/src/assets/bsd.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023, BlockProject 3D
1+
// Copyright (c) 2025, BlockProject 3D
22
//
33
// All rights reserved.
44
//
@@ -56,10 +56,13 @@ pub fn get_exe_path() -> Option<PathBuf> {
5656
//This is where we defer from process_path: we use std::os::unix::ffi::OsStrExt.
5757
let str = OsStr::from_bytes(&buf[..len]);
5858
let path = PathBuf::from(str);
59-
Some(path)
59+
path.parent().map(|v| v.into())
6060
} else {
6161
//FreeBSD with procfs.
62-
std::fs::read_link("/proc/curproc/file").ok()
62+
std::fs::read_link("/proc/curproc/file")
63+
.ok()
64+
.map(|v| v.parent().map(PathBuf::from))
65+
.flatten()
6366
}
6467
}
6568
}

core/src/assets/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub fn get_exe_path() -> Option<PathBuf> {
6767
}
6868
//We finally found the executable file name!
6969
let str1 = OsString::from_wide(&buf[..res as usize]);
70-
Some(str1.into())
70+
Some(PathBuf::from(str1).parent()?.into())
7171
}
7272
}
7373

module_test/test_mod/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ crate-type = ["rlib", "cdylib"]
1111
bp3d-os-build = { version = "1.1.0", path = "../../build" }
1212

1313
[dependencies]
14-
bp3d-os = { version = "2.2.0", path = "../../core", features = ["module"] }
14+
bp3d-os = { version = "2.2.1", path = "../../core", features = ["module"] }
1515
bp3d-debug = "1.0.0"

module_test/testbin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ edition = "2024"
55
publish = false
66

77
[dependencies]
8-
bp3d-os = { version = "2.2.0", path = "../../core", features = ["module"] }
8+
bp3d-os = { version = "2.2.1", path = "../../core", features = ["module"] }

shelltestbin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ edition = "2024"
55
publish = false
66

77
[dependencies]
8-
bp3d-os = { version = "2.2.0", path = "../core", features = ["shell"] }
8+
bp3d-os = { version = "2.2.1", path = "../core", features = ["shell"] }

0 commit comments

Comments
 (0)