forked from ericpruitt/static-glibc-tmux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux-static-build.patch
50 lines (45 loc) · 1.2 KB
/
tmux-static-build.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/cmd-string.c b/cmd-string.c
index e793ea0..f22d85c 100644
--- a/cmd-string.c
+++ b/cmd-string.c
@@ -328,8 +328,6 @@ cmd_string_expand_tilde(const char *s, size_t *p)
envent = environ_find(&global_environ, "HOME");
if (envent != NULL && *envent->value != '\0')
home = envent->value;
- else if ((pw = getpwuid(getuid())) != NULL)
- home = pw->pw_dir;
} else {
cmd_string_ungetc(p);
@@ -342,8 +340,6 @@ cmd_string_expand_tilde(const char *s, size_t *p)
}
*cp = '\0';
- if ((pw = getpwnam(user)) != NULL)
- home = pw->pw_dir;
free(user);
}
diff --git a/tmux.c b/tmux.c
index 631e850..d6a33a6 100644
--- a/tmux.c
+++ b/tmux.c
@@ -88,10 +88,6 @@ getshell(void)
if (checkshell(shell))
return (shell);
- pw = getpwuid(getuid());
- if (pw != NULL && checkshell(pw->pw_shell))
- return (pw->pw_shell);
-
return (_PATH_BSHELL);
}
@@ -328,11 +326,7 @@ main(int argc, char **argv)
if (cfg_file == NULL) {
home = getenv("HOME");
- if (home == NULL || *home == '\0') {
+ if (home && *home == '\0') {
- pw = getpwuid(getuid());
- if (pw != NULL)
- home = pw->pw_dir;
- else
home = NULL;
}
if (home != NULL) {
xasprintf(&cfg_file, "%s/.tmux.conf", home);