[8.51a] Search for tab character alone breaks search history
Moderators: Hacker, petermad, Stefan2, white
[8.51a] Search for tab character alone breaks search history
Hi
1. Search for tab character (copy/paste real tab character, not \t) in Find Files or Lister. Succeeds.
2. Open Find Files or Find in Lister again - text search history is empty.
Config file seems OK:
0=
1=text1
2=text2
...
Seems like value from config file is trimmed upon reading and history read process is stopped when value is empty.
Thanks!
1. Search for tab character (copy/paste real tab character, not \t) in Find Files or Lister. Succeeds.
2. Open Find Files or Find in Lister again - text search history is empty.
Config file seems OK:
0=
1=text1
2=text2
...
Seems like value from config file is trimmed upon reading and history read process is stopped when value is empty.
Thanks!
It's probably related to that issue.
TC stops reading remaining keys if one appears to be empty.
The main cause here seems: Ini files skip leading and trailing whitespace,
i.e. a thing like
will read as "value", and a single tab char stored in the ini will therefore appear as an empty value.
(see for example here)
Probably also related:
Christian seems to correctly use quotes around whitespace for things like-> stored as in ini,
but doesn't store a key at all when I use a single space char as search.
TC stops reading remaining keys if one appears to be empty.
The main cause here seems: Ini files skip leading and trailing whitespace,
i.e. a thing like
Code: Select all
key=__value__
(see for example here)
Probably also related:
Christian seems to correctly use quotes around whitespace for things like
Code: Select all
_abc_
Code: Select all
"_abc_"
but doesn't store a key at all when I use a single space char as search.
TC plugins: PCREsearch and RegXtract
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, the Windows ini reading functions return empty data for just a tab. I can try to put it in double quotes.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
You'd still need to put quotes around it, because otherwise trailing whitespace will still be removed by GetPrivateProfileString.MVV wrote:BOM sequence itself (mentioned in another thread), tab, space... so it won't be empty for INI API.
Fixing it would be nice, but I think the main problem here is: TC shouldn't skip remaining keys if it finds en empty one,
no matter why that key appears empty.
TC plugins: PCREsearch and RegXtract
It is not your problem if you use WritePrivateProfileString to store strings and then GetPrivateProfileString to read them: first one quotes string when necessary (as I remember, if string starts or ends with whitespace and if string starts and ends with quotes) to ensure that second one will read exact string that was passed to first one.
Tab character doesn't break history in 8.52b1 but BOM still does that. Please fix it too, searching for BOMs is quite useful sometimes.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks for confirming the fix. The BOM problem was postponed to TC 9.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com