Ticket #381 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

A bug with (un)selecting by mask

Reported by: a.panov Owned by: slavazanko
Priority: major Milestone: 4.7.0-pre1
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset:

Description

Selection or unselection by mask like this: aaa*.tgz will also select files with characters before the first or after the last, for example 0aaab.tgz aaab.tgz aaab.tgz.md5. It should select only aaab.tgz.

Change History

comment:1 Changed 10 years ago by slavazanko

  • Blocked By 340 added

Actually, this one problem with #340

If #340 will fixed, this bug will fixed too

comment:2 Changed 10 years ago by slavazanko

  • Blocked By 340 removed

(In #340) > press F5/F6 on it

make a '*0*' pattern
rename to '\14\2'

Hm... this mean, all '*' need to translate into (.*) regex...
And, next trouble, search engine handle up to 64 groups pattern match.
for example:

Original string:
_1_ _2_ _3_ _4_ _5_ _6_ _7_ _8_ _9_ _10_ _11_ _12_ _13_ _14_

Search pattern:
(_1_) (_2_) (_3_) (_4_) (_5_) (_6_) (_7_) (_8_) (_9_) (_10_) (_11_) (_12_) (_13_) (_14_)

Replace rule:
\1 ... \14

Result:
_1_ ... _14_

In this case:

rename to '\14\2'

I don't know how will better... may be, '\014\2' or '\{1}4\2'?

Yes, some cleanup of the things you've already did would be very nice, but pushing all of the proper patches through review process would put the project where it is now, decomposing in the cvs coffin.

I'm agree with you. Old development scheme, IMHO, little bit deprecated. Of course, we make mistakes (in 'master' branch too). But better to ask forgiveness than permission. If I'm make a mistake (bug) - I'm apologize and fixed it, This better, what I'm will not make mistakes and that nothing will do but I will wait for permission to do.

Sorry, guys from official devel-team, if the offended. Midnight Commander is in demand, therefore, remain in place it can not be...

comment:3 Changed 10 years ago by slavazanko

  • Owner set to slavazanko
  • Status changed from new to accepted
  • Blocking 365 added

Fix of this bug placed in '365_select_unselect' branch.
changeset:a4f828fb8c7612dd2d67dd80084edbaa701e210b
Therefore, this ticket will closed after close of #365

comment:4 Changed 10 years ago by slavazanko

  • Blocking 365 removed

(In #365) My last change: changeset:a4f828fb8c7612dd2d67dd80084edbaa701e210b

review, please.

comment:5 Changed 10 years ago by slavazanko

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:6 Changed 10 years ago by slavazanko

  • Status changed from testing to closed

comment:8 follow-up: ↓ 9 Changed 10 years ago by a.panov

  • Status changed from closed to reopened
  • Resolution fixed deleted

Previously mc was able to select with masks like this "0*(a|b|c).tgz". Now the result is unpredictable. OK, it now understands "0*{a|b|c}.tgz" instead. But the issue with "()" should be fixed.

comment:9 in reply to: ↑ 8 Changed 10 years ago by andrew_b

Replying to a.panov:

Previously mc was able to select with masks like this "0*(a|b|c).tgz". Now the result is unpredictable. OK, it now understands "0*{a|b|c}.tgz" instead. But the issue with "()" should be fixed.

0*(a|b|c).tgz works if "Using shell patterns" checkbox is off.
0*{a|b|c}.tgz works if "Using shell patterns" checkbox is on.

comment:10 Changed 10 years ago by iNode

Regex template does not match with Options->"Using shell patterns" is off.

Test description:

#!/bin/sh

rm -f *.tst

touch test1.tst test2.tst test3.tst test.tst

cat<<DESCRIPTION
=== test #381 ===
now try select group (M-+):
If  "Using shell patterns" checkbox is on
try pattern: t*{1|2|3}.tst 
else
try pattern: t.*(1|2|3).tst
files test1.tst test2.tst test3.tst should be selected
(press enter to close test description)
DESCRIPTION

read void

In my case selected only test2.tst.
BTW: your regex "t*(1|2|3).tst" should not select any file, but also select test2.tst.

With "Using shell patterns" checkbox is on second pattern select files appropriately.

comment:11 Changed 10 years ago by slavazanko

  • Milestone changed from 4.7 to 4.7.0-pre1

comment:12 Changed 10 years ago by slavazanko

  • Status changed from reopened to closed
  • Resolution set to fixed

This very relative to #305

Now in master this fixed.

Note: See TracTickets for help on using tickets.