[Midnight Commander] #4450: preliminary pcre2 support

3 views
Skip to first unread message

Ticket System

unread,
Mar 12, 2023, 4:40:58 PM3/12/23
to ga...@hotmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
--------------------------------+-----------------------------------
Reporter: broly | Type: enhancement
Status: new | Priority: major
Milestone: Future Releases | Component: mc-core
Version: master | Keywords:
Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
--------------------------------+-----------------------------------
hi,

since my DD-WRT build is now moving to pcre2, i thought i'd give a stab at
providing pcre2 support.

since brainslayer is using an ass-old version of MC, i have provided a
patch set of the changes necessary to use pcre2.

it compiles fine and from what i can see, it runs fine.

but i haven't tested the search properly because i don't want to restart
my router to accommodate the newer glib/pcre (i used LD_LIBRARY_PATH with
the newer libraries to test the new executable).

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450>
Midnight Commander <https://midnight-commander.org>
Midnight Development Center

Ticket System

unread,
Mar 12, 2023, 4:43:20 PM3/12/23
to ga...@hotmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+---------------------------------------
Reporter: broly | Owner:

Type: enhancement | Status: new
Priority: major | Milestone: Future Releases
Component: mc-core | Version: master
Resolution: | Keywords:

Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
----------------------------+---------------------------------------

Comment (by broly):

if anyone wants to fix any potential bugs that may arise from my changes,
use these:

https://github.com/apache/httpd/commit/c602ba14811ede722017c4e59e4e30d9990227b4
#diff-4d479e1bf17e6539c339b182d3c0861a1bd0b0ccbad5226c437d0e30f8cae0c7

https://github.com/i3/i3/issues/4682#issuecomment-973076704

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:1>

Ticket System

unread,
Mar 13, 2023, 1:38:43 AM3/13/23
to ga...@hotmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+---------------------------------------
Reporter: broly | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: Future Releases
Component: mc-search | Version: master
Resolution: | Keywords:

Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
----------------------------+---------------------------------------
Changes (by andrew_b):

* component: mc-core => mc-search


--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:2>

Ticket System

unread,
Mar 15, 2023, 2:04:29 PM3/15/23
to ga...@hotmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+---------------------------------------
Reporter: broly | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: Future Releases
Component: mc-search | Version: master
Resolution: | Keywords:

Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
----------------------------+---------------------------------------

Comment (by andrew_b):

The patch is corrupted:
{{{
$ git apply shitty_pcre2.patch
shitty_pcre2.patch:27: trailing whitespace.
lc_mc_search->num_results = pcre2_match (regex,
shitty_pcre2.patch:53: trailing whitespace.
int pcre_options =
shitty_pcre2.patch:56: trailing whitespace.
#else
shitty_pcre2.patch:62: trailing whitespace.
pcre_options |=
shitty_pcre2.patch:70: trailing whitespace.
pcre_options |=
error: corrupt patch at line 113

}}}

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:3>

Ticket System

unread,
Mar 19, 2023, 2:31:41 PM3/19/23
to ga...@hotmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+---------------------------------------
Reporter: broly | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: Future Releases
Component: mc-search | Version: master
Resolution: | Keywords:

Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
----------------------------+---------------------------------------

Comment (by broly):

Replying to [comment:3 andrew_b]:


> The patch is corrupted:
> {{{
> $ git apply shitty_pcre2.patch
> shitty_pcre2.patch:27: trailing whitespace.
> lc_mc_search->num_results = pcre2_match (regex,
> shitty_pcre2.patch:53: trailing whitespace.
> int pcre_options =
> shitty_pcre2.patch:56: trailing whitespace.
> #else
> shitty_pcre2.patch:62: trailing whitespace.
> pcre_options |=
> shitty_pcre2.patch:70: trailing whitespace.
> pcre_options |=
> error: corrupt patch at line 113
>
> }}}

sorry for the late reply. turns out trying to jam in a forgotten macro
corrupted the patch, because i didn't wanna make a new diff and then
delete all of the differences for the */Makefile.in files xD

the updated patch has been tested and applied on my end this time. check
it out.

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:4>

Ticket System

unread,
Mar 25, 2023, 3:35:38 AM3/25/23
to ga...@hotmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+--------------------------------
Reporter: broly | Owner: andrew_b
Type: enhancement | Status: accepted
Priority: major | Milestone: 4.8.30
Component: mc-search | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:
Branch state: on review | Votes for changeset:
----------------------------+--------------------------------
Changes (by andrew_b):

* owner: => andrew_b
* status: new => accepted
* branch_state: no branch => on review
* milestone: Future Releases => 4.8.30


Comment:

Branch: 4450_pcre2
changeset:49624e473bef82ab56e5e89271f6c4b4cd0f9e5c

@broly it would be nice if you revealed your real name for AUTHORS file.

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:5>

Ticket System

unread,
Apr 2, 2023, 1:55:57 PM4/2/23
to ga...@hotmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+--------------------------------
Reporter: broly | Owner: andrew_b
Type: enhancement | Status: accepted
Priority: major | Milestone: 4.8.30
Component: mc-search | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:
Branch state: approved | Votes for changeset: andrew_b
----------------------------+--------------------------------
Changes (by andrew_b):

* votes: => andrew_b
* branch_state: on review => approved


--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:6>

Ticket System

unread,
Apr 2, 2023, 1:58:54 PM4/2/23
to ga...@hotmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+----------------------------------------
Reporter: broly | Owner: andrew_b
Type: enhancement | Status: testing

Priority: major | Milestone: 4.8.30
Component: mc-search | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:
Branch state: merged | Votes for changeset: committed-master
----------------------------+----------------------------------------
Changes (by andrew_b):

* status: accepted => testing
* votes: andrew_b => committed-master
* resolution: => fixed
* branch_state: approved => merged


Comment:

Merged to master: [86a9e0be2cdf01297c902bc4d52dbca778911834].

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:7>

Ticket System

unread,
Apr 2, 2023, 1:59:54 PM4/2/23
to ga...@hotmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+----------------------------------------
Reporter: broly | Owner: andrew_b
Type: enhancement | Status: closed

Priority: major | Milestone: 4.8.30
Component: mc-search | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:

Branch state: merged | Votes for changeset: committed-master
----------------------------+----------------------------------------
Changes (by andrew_b):

* status: testing => closed


--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:8>

Ticket System

unread,
Aug 27, 2023, 1:21:29 PM8/27/23
to ga...@hotmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4450: preliminary pcre2 support
----------------------------+----------------------------------------
Reporter: broly | Owner: andrew_b
Type: enhancement | Status: closed
Priority: major | Milestone: 4.8.30
Component: mc-search | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:

Branch state: merged | Votes for changeset: committed-master
----------------------------+----------------------------------------

Comment (by eugenesan):

I've been doing some testing with PCRE2 enabled MC and found that it is
~2x faster but provides different search results, which is concerning.

I performed "Find File" with "Content[Regular expression]: ^.*pcre.*$" on
a tree of mixed text, binaries and archives (total ~90k / 3GB).
PCRE2 compiled MC provided ~0.005% (4476 vs 4453) less results when
compared to default search engine.
Most of the misses where in binary files (.jar archives to be precise).

--
Ticket URL: <http://www.midnight-commander.org/ticket/4450#comment:9>

Reply all
Reply to author
Forward
0 new messages