diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-07-02 02:49:19 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-07-02 02:49:19 +0000 |
commit | 63e76b555d8f3d40f9905fb65a58f6e7509d399d (patch) | |
tree | b9b003f298a235899b3d7aa03014d0f27bff13cd /tmux.c | |
parent | 13e7f060b1819ecdb1fcf88eee56293aa8b9f4cf (diff) | |
download | rtmux-63e76b555d8f3d40f9905fb65a58f6e7509d399d.tar.gz rtmux-63e76b555d8f3d40f9905fb65a58f6e7509d399d.tar.bz2 rtmux-63e76b555d8f3d40f9905fb65a58f6e7509d399d.zip |
Sync OpenBSD patchset 730:
Store the current working directory in the session, change the default-path
option to default to empty and make that mean that the stored session CWD is
used.
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.211 2010-07-02 02:45:52 tcunha Exp $ */ +/* $Id: tmux.c,v 1.212 2010-07-02 02:49:19 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -242,7 +242,7 @@ main(int argc, char **argv) struct env_data envdata; struct msg_command_data cmddata; char *s, *shellcmd, *path, *label, *home, *cause; - char cwd[MAXPATHLEN], **var; + char **var; void *buf; size_t len; int opt, flags, quiet = 0, cmdflags = 0; @@ -342,6 +342,7 @@ main(int argc, char **argv) options_set_number(so, "bell-action", BELL_ANY); options_set_number(so, "buffer-limit", 9); options_set_string(so, "default-command", "%s", ""); + options_set_string(so, "default-path", "%s", ""); options_set_string(so, "default-shell", "%s", getshell()); options_set_string(so, "default-terminal", "screen"); options_set_number(so, "detach-on-destroy", 1); @@ -438,15 +439,6 @@ main(int argc, char **argv) options_set_number(wo, "utf8", 0); } - if (getcwd(cwd, sizeof cwd) == NULL) { - pw = getpwuid(getuid()); - if (pw->pw_dir != NULL && *pw->pw_dir != '\0') - strlcpy(cwd, pw->pw_dir, sizeof cwd); - else - strlcpy(cwd, "/", sizeof cwd); - } - options_set_string(so, "default-path", "%s", cwd); - if (cfg_file == NULL) { home = getenv("HOME"); if (home == NULL || *home == '\0') { |