+[TC8.50b7]Regex search file names cut off at 2045 chars
Moderators: Hacker, petermad, Stefan2, white
+[TC8.50b7]Regex search file names cut off at 2045 chars
* 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)
* 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)
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Sorry, this is the maximum length. Currently there are no plans to make it longer.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
??? I am asking to make it 1 character shorter....ghisler(Author) wrote:Sorry, this is the maximum length. Currently there are no plans to make it longer.
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.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
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.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.![]()
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Great, then I will implement it in the 64-bit version too!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com