tcsh/tcsh-6.17.00-dont-set-empty-remotehost.patch
2011-01-24 16:16:41 +01:00

19 lines
708 B
Diff

--- tcsh-6.17.00-orig/tc.func.c 2009-06-25 23:15:38.000000000 +0200
+++ tcsh-6.17.00/tc.func.c 2011-01-14 12:48:54.959051220 +0100
@@ -2025,12 +2025,13 @@ remotehost(void)
}
wait_options = 0;
done:
+ cleanup_push(&hostname, strbuf_cleanup);
xclose(fds[0]);
while ((wait_res = waitpid(pid, &status, wait_options)) == -1
&& errno == EINTR)
handle_pending_signals();
- cleanup_push(&hostname, strbuf_cleanup);
- if (wait_res == pid && WIFEXITED(status) && WEXITSTATUS(status) == 0) {
+ if (hostname.len > 0 && wait_res == pid && WIFEXITED(status)
+ && WEXITSTATUS(status) == 0) {
strbuf_terminate(&hostname);
tsetenv(STRREMOTEHOST, str2short(hostname.s));
}