[8.01-32bit] Lister, regex search backwards

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[8.01-32bit] Lister, regex search backwards

Post by *white »

* Decode and unzip the file "testfile.txt" included below.
* View the file in Lister
* Search for "^[^ ]", Regex checked (search for non space character at the beginning of a line)
B(EGIN) is found
* Press F3 to repeat the search
E(END) is found
* Press Shift-F3 to repeat search backwards
t(ext) is found in the middle of a line?

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="testfile.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testfile.zip"

UEsDBBQAAgAIALOQ70JielRM8wEAAJ0QAgAMAAAAdGVzdGZpbGUudHh07c2xDQAQEADAXmIHswgR
zW9hA4XxbaDTXXPt1T5m5FT2OvsfAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQC
gUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKB
QCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFA
IBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAg
EAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQ
CAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAI
BAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgE
AoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQC
gUAgEAgEAoFAIBAIBAKBQCAQCAQCgUDwCnq0C1BLAQIUABQAAgAIALOQ70JielRM8wEAAJ0QAgAM
AAAAAAAAAAEAIAAAAAAAAAB0ZXN0ZmlsZS50eHRQSwUGAAAAAAEAAQA6AAAAHQIAAAAA
Same applies to older versions of Total Commander.
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

Hmm, looks like when TC searches using a RegEx backwards, it stops every 64KB and instead of continuing, it considers it as a start of the text.

In your example, both such boundaries are inside a text, which causes the RegEx to match them. If you modify the example, like adding a single space after the "BEGIN", the boundaries will move between words and the RegEx won't match them anymore.

Note: Take this with a grain of salt. I don't really know the cause of the problem, I just think, this is it.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

The problem still exists in TC 8.50b2a.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm sorry, I could not find a solution.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

HISTORY.TXT wrote:13.10.13 Fixed: Lister, search backwards for regular expressions -> ignore results which start at offset 0 of the search buffer (except at the start of the file) to avoid invalid results (e.g. when searching for the start of a line) (32/64)
Tested OK using TC 8.50b6 32 bit.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It was quite tricky to fix, so I hope that it didn't introduce any new errors...
Author of Total Commander
https://www.ghisler.com
Post Reply