On Thursday 13 September 2007 09:30, Pavel Tsekov wrote:
> Hello,
> 
> I've prepared the fist pre-release of GNU Midnight Commander 4.6.2 . Please, 
> download it and give it a try.

I found the following issues:


Alt-O behavior changes for the worse:

4.6.1: make inactive panel show the same dir as active one

4.6.2: make inactive panel show the .. if we stand on non directory
       or directory we stand on.

I find 4.6.1 behavior more consistent and useful.


F5-copying a file on itself bring "Error: FILE and FILE are the same file"
without buttons. Pressing ESC dismisses it

But if you did this on a big directory (e.g. kernel source tree),
you will get "Error: FILE2 and FILE2 are the same file", then
"Error: FILE3 and FILE3 are the same file"
....
"Error: FILE91476981243 and FILE91476981243 are the same file"
...
without the possibility to stop the stream of messages.
mc insists on making you see them all.
On big directory, you may need to hold ESC depressed for minutes
in order to dismiss them all.

I sent a patch which fixes this by adding [skip] and [abort] buttons.
In case it was missed, I attach it again now. Applies with some offsets,
run-tested.


I am pleased with some new and improved features. For example, "Find file"
how has "[x] Regular expression". Good work, thanks!
--
vda
diff -urpN mc-4.6.1.org/src/file.c mc-4.6.1.cp/src/file.c
--- mc-4.6.1.org/src/file.c	2005-05-27 16:19:18.000000000 +0200
+++ mc-4.6.1.cp/src/file.c	2007-05-18 16:00:23.000000000 +0200
@@ -458,6 +458,25 @@ enum {
     DEST_FULL			/* Created, fully copied */
 };
 
+static int warn_same_file(const char *fmt, const char *a, const char *b)
+{
+    char *msg;
+    /* We don't expect %d etc, just %s, so strlen(fmt) should be ok */
+    int n = strlen(fmt) + strlen(a) + strlen(b) + 1;
+
+    msg = malloc(n);
+    if (msg) {
+	snprintf(msg, n, fmt, a, b);
+	n = query_dialog (MSG_ERROR, msg,
+		D_ERROR, 2, _("&Skip"), _("&Abort"));
+	free(msg);
+	do_refresh ();
+	if (n) /* 1 == Abort */
+	    return FILE_ABORT;
+    }
+    return FILE_SKIP;
+}
+
 int
 copy_file_file (FileOpContext *ctx, const char *src_path, const char *dst_path,
 		int ask_overwrite, off_t *progress_count,
@@ -512,12 +531,9 @@ copy_file_file (FileOpContext *ctx, cons
 
     if (dst_exists) {
 	/* Destination already exists */
-	if (sb.st_dev == sb2.st_dev && sb.st_ino == sb2.st_ino) {
-	    message (1, MSG_ERROR,
-		    _(" `%s' and `%s' are the same file "), src_path, dst_path);
-	    do_refresh ();
-	    return FILE_SKIP;
-	}
+	if (sb.st_dev == sb2.st_dev && sb.st_ino == sb2.st_ino)
+	    return warn_same_file(_(" `%s' and `%s' are the same file "),
+				src_path, dst_path);
 
 	/* Should we replace destination? */
 	if (ask_overwrite) {
@@ -1043,22 +1059,8 @@ move_file_file (FileOpContext *ctx, cons
 
     if (mc_lstat (d, &dst_stats) == 0) {
 	if (src_stats.st_dev == dst_stats.st_dev
-	    && src_stats.st_ino == dst_stats.st_ino) {
-	    int msize = COLS - 36;
-	    char st[MC_MAXPATHLEN];
-	    char dt[MC_MAXPATHLEN];
-
-	    if (msize < 0)
-		msize = 40;
-	    msize /= 2;
-
-	    strcpy (st, path_trunc (s, msize));
-	    strcpy (dt, path_trunc (d, msize));
-	    message (1, MSG_ERROR,
-			_(" `%s' and `%s' are the same file "), st, dt);
-	    do_refresh ();
-	    return FILE_SKIP;
-	}
+	    && src_stats.st_ino == dst_stats.st_ino)
+	    return warn_same_file(_(" `%s' and `%s' are the same file "), s, d);
 
 	if (S_ISDIR (dst_stats.st_mode)) {
 	    message (1, MSG_ERROR,
@@ -1161,22 +1163,8 @@ move_dir_dir (FileOpContext *ctx, const 
     } else
 	destdir = concat_dir_and_file (d, x_basename (s));
 
-    if (sbuf.st_dev == dbuf.st_dev && sbuf.st_ino == dbuf.st_ino) {
-	int msize = COLS - 36;
-	char st[MC_MAXPATHLEN];
-	char dt[MC_MAXPATHLEN];
-
-	if (msize < 0)
-	    msize = 40;
-	msize /= 2;
-
-	strcpy (st, path_trunc (s, msize));
-	strcpy (dt, path_trunc (d, msize));
-	message (1, MSG_ERROR,
-		    _(" `%s' and `%s' are the same directory "), st, dt);
-	do_refresh ();
-	return FILE_SKIP;
-    }
+    if (sbuf.st_dev == dbuf.st_dev && sbuf.st_ino == dbuf.st_ino)
+	return warn_same_file(_(" `%s' and `%s' are the same directory "), s, d);
 
     /* Check if the user inputted an existing dir */
   retry_dst_stat:
_______________________________________________
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel

Reply via email to