2005-06-06 13:25:29 +00:00
|
|
|
--- mc-4.6.1a/src/main.c.userhost 2005-06-06 13:35:08.926427736 +0200
|
|
|
|
+++ mc-4.6.1a/src/main.c 2005-06-06 13:39:11.551543112 +0200
|
2005-03-24 14:34:59 +00:00
|
|
|
@@ -32,6 +32,7 @@
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
+#include <pwd.h>
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
#include "tty.h"
|
2005-06-06 13:25:29 +00:00
|
|
|
@@ -1611,9 +1612,22 @@ void
|
2005-03-24 14:34:59 +00:00
|
|
|
update_xterm_title_path (void)
|
|
|
|
{
|
2005-06-06 13:25:29 +00:00
|
|
|
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
|
|
|
|
if (!is_printable ((unsigned char) *s))
|