CMB / edbrowse

A command-line editor and web browser.
Other
345 stars 31 forks source link

libpcre2 #73

Closed sylware closed 3 years ago

sylware commented 3 years ago

Hi, I wrote a patch as a attempt to port edbrowse to libpcre2. I understand nearly nothing, then it is probably garbage, but it seems to work. The patch is on pastebin since github does not work with noscript/basic (x)html browser for patch submission (the name is weird, it is expected): https://paste.c-net.org/TrailingMentions

KevinCarhart commented 3 years ago

Hi sylware When I load your patch from edbrowse, I can receive your patch fine. I can tell that it's plain text. But when I load it from a GUI browser, my antivirus software Malwarebytes issues a warning, "malicious site." It's a false alarm but maybe it would be a good idea to delete the link after we've received it from you so that it does not sit here and confuse anyone else who passes through and clicks it. I would also not want github to penalize us if they have some kind of indiscriminate checker.

eklhad commented 3 years ago

This is a nice patch, and I thank you for your hard work. We'll have to bat around the usual questions of: is it backward compatible with pcre1 relative to edbrowse, any important differences, are there systems / distros that support pcre1 not pcre2, are there systems / distros that support pcre2 not pcre1, (I guess yours is one of those??), etc. I wouldn't want to step forward and then find other people who can't build edbrowse for want of pcre2.

I just installed pcre2, and will play around a bit.

Thoughts welcome.

Karl Dahlke

eklhad commented 3 years ago

Got it to build with some minor tweaks, like

define PCRE2_CODE_UNIT_WIDTH 8

and that's all fine, but then edit any file and /x/ doesn't work, even though plenty of lines with x. On a line that has x s/x/y/ doesn't work.

re_count < -1 indicating some sort of error. Not sure what that's about. Hmm.

Karl Dahlke

sylware commented 3 years ago

yeah, this is what I suspected, a near brain dead portage from libpcre1 to libpcre2 broke some stuff. I don't have libpcre on my glibc/linux distro and I thought only libpcre2 was deployed (I did a naive search).

eklhad commented 3 years ago

Ok, I got it working, you were almost there. I had to move the match_data = line up where the expression is compiled, these two allocated structures rise and fall together. It seems to work now, 1d9a2e966ddb5242d79e4b6e238124c4be81f6dd hopefully what you were hoping for. Thanks for the head start on this, it needed to be done, as pcre1 is gradually being phased out.

Karl Dahlke

sylware commented 3 years ago

:) thx! I can keep my libpcre2 build script then :P