[PATCH] Do not select symlinked dirs as files

2003-06-11 Thread David Sterba
Hi,

this patch changes selection of files and dirs so that
symlinked dirs are not selected as files, but only
as directories (i.e. with / appended to file mask in selection dialog).

'Select', 'Unselect' and 'Reverse select' are consistent.

I think this i correct behaviour.

David
2003-06-11  David Sterba  [EMAIL PROTECTED]

* cmd.c (select_cmd, unselect_cmd, reverse_selection_cmd):
Handle symlinked directories as directories in file selections.

diff -X .diffignore -urNp mc/src/cmd.c mc-1ft/src/cmd.c
--- mc-sel/src/cmd.c	Tue Feb 18 06:25:45 2003
+++ mc/src/cmd.c	Wed Jun 11 12:46:03 2003
@@ -502,7 +502,8 @@ void reverse_selection_cmd (void)
 
 for (i = 0; i  cpanel-count; i++){
 	file = cpanel-dir.list [i];
-	if (S_ISDIR (file-buf.st_mode))
+	if (S_ISDIR (file-buf.st_mode) ||
+	link_isdir ( (cpanel-dir.list [i]) ))
 	continue;
 	do_file_mark (cpanel, i, !file-f.marked);
 }
@@ -535,7 +536,8 @@ void select_cmd (void)
 for (i = 0; i  cpanel-count; i++){
 if (!strcmp (cpanel-dir.list [i].fname, ..))
 continue;
-	if (S_ISDIR (cpanel-dir.list [i].buf.st_mode)){
+	if (S_ISDIR (cpanel-dir.list [i].buf.st_mode) ||
+	link_isdir ( (cpanel-dir.list [i]) )) {
 	if (!dirflag)
 continue;
 } else {
@@ -579,9 +581,10 @@ void unselect_cmd (void)
 reg_exp_t [strlen(reg_exp_t) - 1] = 0;
 }
 for (i = 0; i  cpanel-count; i++){
-if (!strcmp (cpanel-dir.list [i].fname, ..)) 
+if (!strcmp (cpanel-dir.list [i].fname, ..))
 continue;
-	if (S_ISDIR (cpanel-dir.list [i].buf.st_mode)){
+	if (S_ISDIR (cpanel-dir.list [i].buf.st_mode) ||
+	link_isdir ( (cpanel-dir.list [i]) )) {
 	if (!dirflag)
 	continue;
 } else {


(no subject)

2003-06-11 Thread David Sterba
Hi,

I'd like to ask, what is the rason of excluding operation 'Move' from
computing totals in panel_operate() [file.c:2023] ?

code:
-- file.c -
// this vvv
if (operation != OP_MOVE  verbose  file_op_compute_totals) {
panel_compute_totals (panel, ctx-progress_count,
  ctx-progress_bytes);
---

Without the first condition the progress dialog of 'Move' shows the same
information about 'totals' as 'Copy'.

David

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH] Do not select symlinked dirs as files

2003-06-11 Thread Ali Akcaagac
On Wed, 2003-06-11 at 13:16, David Sterba wrote:
 I think this i correct behaviour.

I don't like this. I want when selecting all that symlinks are being
selected as well. With other words. It should behave as it is now.

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH] Do not select symlinked dirs as files

2003-06-11 Thread David Sterba
Hi,

 I don't like this. I want when selecting all that symlinks are being
 selected as well. With other words. It should behave as it is now.

Well, let's make it optional then (in 'Configuration' menu), because
it is not always the desired behaviour.

David

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel