Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2025-09-08 14:01:08 +01:00
2 changed files with 12 additions and 10 deletions

View File

@@ -201,7 +201,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
cdata->flags |= CMD_PARSE_QUIET; cdata->flags |= CMD_PARSE_QUIET;
if (args_has(args, 'n')) if (args_has(args, 'n'))
cdata->flags |= CMD_PARSE_PARSEONLY; cdata->flags |= CMD_PARSE_PARSEONLY;
if (args_has(args, 'v') && (~c->flags & CLIENT_CONTROL)) if (args_has(args, 'v') && (c == NULL || ~c->flags & CLIENT_CONTROL))
cdata->flags |= CMD_PARSE_VERBOSE; cdata->flags |= CMD_PARSE_VERBOSE;
cwd = cmd_source_file_quote_for_glob(server_client_get_cwd(c, NULL)); cwd = cmd_source_file_quote_for_glob(server_client_get_cwd(c, NULL));

2
job.c
View File

@@ -139,6 +139,7 @@ job_run(const char *cmd, int argc, char **argv, struct environ *e,
proc_clear_signals(server_proc, 1); proc_clear_signals(server_proc, 1);
sigprocmask(SIG_SETMASK, &oldset, NULL); sigprocmask(SIG_SETMASK, &oldset, NULL);
if (cwd != NULL) {
if (chdir(cwd) == 0) if (chdir(cwd) == 0)
environ_set(env, "PWD", 0, "%s", cwd); environ_set(env, "PWD", 0, "%s", cwd);
else if ((home = find_home()) != NULL && chdir(home) == 0) else if ((home = find_home()) != NULL && chdir(home) == 0)
@@ -147,6 +148,7 @@ job_run(const char *cmd, int argc, char **argv, struct environ *e,
environ_set(env, "PWD", 0, "/"); environ_set(env, "PWD", 0, "/");
else else
fatal("chdir failed"); fatal("chdir failed");
}
environ_push(env); environ_push(env);
environ_free(env); environ_free(env);