Bug 629679 - Midnight Commander use * globbing badly
Summary: Midnight Commander use * globbing badly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mc
Version: 13
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 640053 642063 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-02 17:14 UTC by rvcsaba
Modified: 2013-07-02 23:47 UTC (History)
9 users (show)

Fixed In Version: mc-4.7.4-2.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-14 22:59:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed patch (1.15 KB, patch)
2010-10-06 12:11 UTC, Denys Vlasenko
no flags Details | Diff

Description rvcsaba 2010-09-02 17:14:51 UTC
Description of problem:

If I use shell globbing in copy or move, mc use it badly. I make a backup copy same directory:

source mask: *

to: *1

Midnight Commander use original name, without '1'.

Version-Release number of selected component (if applicable):

mc-4.7.3-2.fc13.x86_64

How reproducible:

This is a regression.

mkdir -p tmp/a
cd tmp/a
>file.txt
cd ..

I use mc Copy (F5):

Copy directory "a" with source mask:
*

to:
*1

┌──────────── Error ─────────────┐
│ "/home/common/temp/a/file.txt" │
│ and                            │
│ "./a/file.txt"                 │
│ are the same file              │
│                                │
│      [ Skip ]  [ Abort ]       │
└────────────────────────────────┘

Because target directory name 'a', not 'a1'.

Actual results:

Bad target directory name.

Expected results:

Good target directory name, copy is OK.

Comment 1 rvcsaba 2010-09-07 21:55:01 UTC
This problem is actually in mc-4.7.4-1.fc13.x86_64.

Comment 2 rvcsaba 2010-09-15 08:58:04 UTC
Opening terminal.

mkdir mc_demo
cd mc_demo
>test
mc

Select test. Push F5 - Copy. Source mask *, to *.old. Target file name ".old", not a "test.old". :(

Select test. Push F5 - Copy. Source mask *, to *1. You get error message, because target file name same, then source file name. :( Correct name "test1", but bad name "test". :(

Comment 3 Tomas Mraz 2010-10-04 06:54:10 UTC
Yes, this is a serious regression in mc globbing behavior. Please fix ASAP!

Comment 4 Tomas Mraz 2010-10-04 07:11:06 UTC
Also present in mc-4.7.3-2.fc13 which gives a hint that it is regression from the bug 624973 or bug 576622 fix.

Comment 5 Michael Schwendt 2010-10-05 16:14:01 UTC
Also affects "Move" (F6):

1. press F7, create test directory "1"
2. enter dir "1"
3. run "touch bar"
4. highlight file "bar"
5. press F6 to open "Move" dialog, move "*" to "fu*"

Result is: fu\
Should be: fubar

Comment 6 Michael Schwendt 2010-10-05 16:14:24 UTC
*** Bug 640053 has been marked as a duplicate of this bug. ***

Comment 7 Denys Vlasenko 2010-10-06 12:11:41 UTC
Created attachment 451876 [details]
Proposed patch

Run-tested.

Also submitted upstream:

http://www.midnight-commander.org/ticket/2327

Comment 8 Jindrich Novy 2010-10-07 07:18:29 UTC
Thanks for the patch.

The patch is quite redundant so after all the crap removal, this is the relevant fix for the issue:

@@ -144,7 +144,6 @@ mc_search__translate_replace_glob_to_reg
             {
                 g_string_append_c (buff, '\\');
                 c = ++cnt;
-                continue;
             }
             break;
             /* breaks copying: mc uses "\0" internally, it must not be changed */

Fixed in rawhide for now. Updates are in progress. Please give them positive karma to see them in stable Fedoras soon.

Thanks!

Comment 9 Marcela Mašláňová 2010-10-07 07:38:38 UTC
Thanks, work in rawhide.

Comment 10 Fedora Update System 2010-10-07 08:22:07 UTC
mc-4.7.4-2.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mc-4.7.4-2.fc13

Comment 11 Fedora Update System 2010-10-07 08:22:24 UTC
mc-4.7.4-2.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mc-4.7.4-2.fc12

Comment 12 Fedora Update System 2010-10-07 08:22:41 UTC
mc-4.7.4-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mc-4.7.4-2.fc14

Comment 13 rvcsaba 2010-10-07 08:31:11 UTC
mc-4.7.4-2.fc14.x86_64 work. Thank you!

Comment 14 Fedora Update System 2010-10-07 19:52:42 UTC
mc-4.7.4-2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mc'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/mc-4.7.4-2.fc14

Comment 15 Jindrich Novy 2010-10-12 05:42:28 UTC
*** Bug 642063 has been marked as a duplicate of this bug. ***

Comment 16 Fedora Update System 2010-10-14 22:59:43 UTC
mc-4.7.4-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2010-10-17 04:50:12 UTC
mc-4.7.4-2.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2010-11-05 22:53:09 UTC
mc-4.7.4-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.