+[TC8.50b7]Regex search file names cut off at 2045 chars

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

Moderators: Hacker, petermad, Stefan2, white

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

+[TC8.50b7]Regex search file names cut off at 2045 chars

Post by *white »

* Alt-F7 (Search)
* Enable RegEx
* In the Search for field enter an expression with maximum length (2046 characters)
* Click on Start search
Result: last character of search expression is cut off before search is performed.

It seems that when using RegEx the first character of the search string is reserved for "<".

Solutions:
* Limit the maximum length of the text entered in the edit box to 2045 characters
* Change the limit from 2046 into 2045 characters only when RegEx is enabled. Downside: what to do if user first enters 2046 chars and then enables RegEx? Show error or again cut off character?

(Bug also exists in TC 8.01)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, this is the maximum length. Currently there are no plans to make it longer.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Sorry, this is the maximum length. Currently there are no plans to make it longer.
??? I am asking to make it 1 character shorter....

The user will not notice it when you silently cut off 1 character at the end. The user may make wrong decisions depending on the search results.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem is that I can't - I have to allow the longer length for the '<' character when it's in the dropdown part of the list. :(
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:The problem is that I can't - I have to allow the longer length for the '<' character when it's in the dropdown part of the list. :(
I don't understand. Setting the MaxLength property of a combobox only limits the length of the string the user enters. It doesn't limit the length of the string the box (edit part or dropdown part) can hold.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I think that I found the problem: GetWindowTextW seems to expect the length of the buffer (in words), but the Windows docs say that it expects the maximum number of characters (which, imho, does not include the terminating 0). Requesting one more character seems to handle the above problem just fine, please test it!
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Tested OK using TC 8.50b8 32bit.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Great, then I will implement it in the 64-bit version too!
Author of Total Commander
https://www.ghisler.com
Post Reply