Re: uglydir patch



With changelog entries this time.

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

src/Changelog:

	* screen.c (show_dir): Print question mark for unprintable characters
	in path name.
	* subshell.c (feed_subshell): Fix for CWD with newlines.

--- mc-4.6.1-20041109/src/screen.c.uglydir	2004-11-07 13:42:53.000000000 +0100
+++ mc-4.6.1-20041109/src/screen.c	2004-11-10 02:20:42.000000000 +0100
@@ -759,6 +759,14 @@ show_dir (WPanel *panel)
 
     trim (strip_home_and_password (panel->cwd), tmp,
 	 min (max (panel->widget.cols - 7, 0), panel->widget.cols) );
+
+	if (tmp && *tmp) {
+	char *s = tmp;
+	do {
+	    if (!is_printable (*s))
+		*s = '?';
+	} while (*++s);
+    }
     addstr (tmp);
     g_free (tmp);
     widget_move (&panel->widget, 0, 1);
--- mc-4.6.1-20041020/src/subshell.c.uglydir	2004-09-25 15:46:23.000000000 +0200
+++ mc-4.6.1-20041020/src/subshell.c	2004-10-22 10:35:22.863653088 +0200
@@ -951,6 +951,23 @@ feed_subshell (int how, int fail_on_erro
 
 	    subshell_cwd[bytes - 1] = 0;	/* Squash the final '\n' */
 
+	    if (*subshell_cwd && current_panel && current_panel->cwd &&
+			strcmp(current_panel->cwd, subshell_cwd) &&
+			strchr(current_panel->cwd, '\n'))
+	    {
+		/* Expected CWD is different and it contains line break.
+		 * We need to read rest of CWD, because previous read()
+		 * returns first line only.
+		 */
+		int rbytes;
+
+		subshell_cwd[bytes-1] = '\n';
+		rbytes = read(subshell_pipe[READ], (subshell_cwd+bytes),
+			MC_MAXPATHLEN-bytes);
+		if (rbytes)
+		    subshell_cwd[bytes+rbytes-1] = 0;  /* Squash the final '\n' */
+	    }
+
 	    synchronize ();
 
 	    subshell_ready = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]