2005-07-08 09:56:28 +00:00
|
|
|
--- mc-4.6.1-pre5/src/main.c.userhost 2005-07-08 11:04:37.718907992 +0200
|
|
|
|
+++ mc-4.6.1-pre5/src/main.c 2005-07-08 11:07:53.888085744 +0200
|
|
|
|
@@ -33,6 +33,7 @@
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
2005-03-24 14:34:59 +00:00
|
|
|
|
2005-07-08 09:56:28 +00:00
|
|
|
+#include <pwd.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <signal.h>
|
|
|
|
@@ -1607,9 +1608,22 @@ void
|
2005-03-24 14:34:59 +00:00
|
|
|
update_xterm_title_path (void)
|
|
|
|
{
|
2005-07-08 09:56:28 +00:00
|
|
|
unsigned char *p, *s;
|
2005-03-24 14:34:59 +00:00
|
|
|
+ char h[64];
|
|
|
|
+ struct passwd *pw;
|
|
|
|
|
|
|
|
if (xterm_flag && xterm_title) {
|
|
|
|
p = s = g_strdup (strip_home_and_password (current_panel->cwd));
|
2005-06-06 13:25:29 +00:00
|
|
|
+ if ( !gethostname (h, 64) ) {
|
|
|
|
+ h[63] = '\0'; /* Be sure the hostname is NUL terminated */
|
|
|
|
+ s = g_strdup_printf ("%s:%s", h, s);
|
|
|
|
+ g_free (p);
|
|
|
|
+ p = s;
|
|
|
|
+ }
|
|
|
|
+ if ( (pw = getpwuid(getuid())) ) {
|
|
|
|
+ s = g_strdup_printf ("%s@%s", pw->pw_name, s);
|
|
|
|
+ g_free (p);
|
|
|
|
+ p = s;
|
|
|
|
+ }
|
2005-03-24 14:34:59 +00:00
|
|
|
do {
|
2005-06-06 13:25:29 +00:00
|
|
|
#ifndef UTF8
|
2005-07-08 09:56:28 +00:00
|
|
|
if (!is_printable (*s))
|