aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-11-24 19:42:28 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-11-24 19:42:28 -0500
commit9b8c4beb1e64579792fca7c161c9e3b0691e67d4 (patch)
tree79e8375694e63c2e3b3d017c47f6d75c21c53d9e
parent19349dff649ac8039e8d13e07d33cbdc6f6655b9 (diff)
When running an executable, run it with a relative instead of absolute
path so it shows up more nicely in the usage
-rw-r--r--src/tomo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tomo.c b/src/tomo.c
index 97857286..66ac0ddf 100644
--- a/src/tomo.c
+++ b/src/tomo.c
@@ -423,7 +423,8 @@ int main(int argc, char *argv[]) {
pid_t child = i == (int64_t)run_files.length - 1 ? 0 : fork();
if (child == 0) {
const char *prog_args[1 + args.length + 1];
- prog_args[0] = (char *)Path$as_c_string(exe_path);
+ Path_t relative_exe = Path$relative_to(exe_path, Path$current_dir());
+ prog_args[0] = (char *)Path$as_c_string(relative_exe);
for (int64_t j = 0; j < (int64_t)args.length; j++)
prog_args[j + 1] = *(const char **)(args.data + j * args.stride);
prog_args[1 + args.length] = NULL;