mirror of
https://github.com/tmux/tmux.git
synced 2025-09-10 05:18:17 +00:00
Merge branch 'obsd-master'
This commit is contained in:
@@ -201,7 +201,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
|
||||
cdata->flags |= CMD_PARSE_QUIET;
|
||||
if (args_has(args, 'n'))
|
||||
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;
|
||||
|
||||
cwd = cmd_source_file_quote_for_glob(server_client_get_cwd(c, NULL));
|
||||
|
20
job.c
20
job.c
@@ -50,7 +50,7 @@ struct job {
|
||||
|
||||
char *cmd;
|
||||
pid_t pid;
|
||||
char tty[TTY_NAME_MAX];
|
||||
char tty[TTY_NAME_MAX];
|
||||
int status;
|
||||
|
||||
int fd;
|
||||
@@ -139,14 +139,16 @@ job_run(const char *cmd, int argc, char **argv, struct environ *e,
|
||||
proc_clear_signals(server_proc, 1);
|
||||
sigprocmask(SIG_SETMASK, &oldset, NULL);
|
||||
|
||||
if (chdir(cwd) == 0)
|
||||
environ_set(env, "PWD", 0, "%s", cwd);
|
||||
else if ((home = find_home()) != NULL && chdir(home) == 0)
|
||||
environ_set(env, "PWD", 0, "%s", home);
|
||||
else if (chdir("/") == 0)
|
||||
environ_set(env, "PWD", 0, "/");
|
||||
else
|
||||
fatal("chdir failed");
|
||||
if (cwd != NULL) {
|
||||
if (chdir(cwd) == 0)
|
||||
environ_set(env, "PWD", 0, "%s", cwd);
|
||||
else if ((home = find_home()) != NULL && chdir(home) == 0)
|
||||
environ_set(env, "PWD", 0, "%s", home);
|
||||
else if (chdir("/") == 0)
|
||||
environ_set(env, "PWD", 0, "/");
|
||||
else
|
||||
fatal("chdir failed");
|
||||
}
|
||||
|
||||
environ_push(env);
|
||||
environ_free(env);
|
||||
|
Reference in New Issue
Block a user