[TC 11.03] Search for \ and leading and trailing spaces

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

Moderators: Hacker, petermad, Stefan2, white

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

[TC 11.03] Search for \ and leading and trailing spaces

Post by *white »

Search text to search for all files, do not search in subfolders:

Code: Select all

\
Add 1 trailing space and it still works. But if you add more trailing spaces, it no longer works. And if you add any leading spaces, it also doesn't work.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *ghisler(Author) »

Sorry, I do not understand your report. What are you trying to achieve?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *petermad »

2ghisler(Author)

I think White expects expects all leading or trailing spaces to be ignored.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *white »

ghisler(Author) wrote: 2024-07-08, 13:58 UTC Sorry, I do not understand your report. What are you trying to achieve?
Like I said: "search for all files, do not search in subfolders". The search text contains an empty mask for searching files/folders, which in Total Commander means *.*, and an empty include only traverse folder "\". So traverse only the folder with an empty name ;). After adding 1 trailing space, it still works. But with more spaces added or with leading spaces added, it no longer works.
petermad wrote: 2024-07-08, 14:18 UTC I think White expects expects all leading or trailing spaces to be ignored.
Correctamundo. The results should be the same as when using no spaces or 1 trailing space.
User avatar
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *jonathanpoulin »

Interestingly, this search string below works (2 leading\trailing spaces, 2 between tokens).

Code: Select all

  \  *.*  
So, it doesn't work only when "empty mask" is used.

2white

Was it working in previous TC version?
Thanks,
Jonathan Poulin
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *white »

jonathanpoulin wrote: 2024-07-10, 11:29 UTC So, it doesn't work only when "empty mask" is used.
Correct, that is what I am addressing. The issue isn't limited to only using a single "\" with one or more spaces. The same applies to searching for, for example, "dir\" when you have a folder called "dir".
So this example with an empty mask for file/folder specification also works:

Code: Select all

dir\
This is essentially the same as "dir\ *.*" or "*.* dir\"
After adding one trailing space to the code, it still works. But adding more spaces, or adding leading spaces, causes it to no longer work.
jonathanpoulin wrote: 2024-07-10, 11:29 UTC Was it working in previous TC version?
This is working this way since version TC 11.00b7 (nothing relevant in HISTORY.TXT AFAIK).
Before that, an empty mask for file/folder specification in combination with an include only folder wasn't supported. It did however work with exclude, for example:

Code: Select all

| dir\
This did and does the same thing as "*.* | dir\"
However, when you add leading spaces to the code, it no longer works. As reported in my other bug report.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *ghisler(Author) »

Please use
*.* \
to find all files and subfolders in the current directory, but nothing in subdirs.
\
alone isn't defined, it also finds nothing with Everything, while *.* \ does.

I'm sorry but I will not try to detect all possible invalid or undocumented search strings and show errors when I encounter them. I would be doing only that for the next 10 years.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *white »

ghisler(Author) wrote: 2024-07-10, 17:14 UTC Please use
*.* \
to find all files and subfolders in the current directory, but nothing in subdirs.
\
alone isn't defined, it also finds nothing with Everything, while *.* \ does.

I'm sorry but I will not try to detect all possible invalid or undocumented search strings and show errors when I encounter them. I would be doing only that for the next 10 years.
1) You act like it's weird to enter nothing if you want to search for all files/folders. But it has been this way since at least Windows Commander 3.03 (I checked). And I don't think it's an accident that searching for "dir\" or "|*.bak" assumes * as the file/folder mask.

2) *.* stems from the MS-DOS era and is also not documented. Nowadays it makes more sense to talk about using *.

3) You've added more and more complexity by adding functionality to the same 'Search for' field over and over again. The help text is very poor at explaining, so the functionality is actually badly documented.
User avatar
tuska
Power Member
Power Member
Posts: 4046
Joined: 2007-05-21, 12:17 UTC

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *tuska »

ghisler(Author) wrote: 2024-07-10, 17:14 UTC \
alone isn't defined, it also finds nothing with Everything, ...
No, it only finds folders in 'Everything' and TC (ev:\).
You get the same result with the 'Everything' modifier: ... folder:

Everything 1.5.0.1383a (x64)
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *JOUBE »

white wrote: 2024-07-08, 17:19 UTC The results should be the same as when using no spaces or 1 trailing space.
No.
white wrote: 2024-07-10, 18:53 UTC 2) *.* stems from the MS-DOS era and is also not documented. Nowadays it makes more sense to talk about using *.
No.
Last edited by JOUBE on 2024-07-11, 12:12 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *petermad »

white wrote: 2024-07-08, 17:19 UTC The results should be the same as when using no spaces or 1 trailing space.
I agree. Spaces should only be recognized as such if they are quoted.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *JOUBE »

petermad wrote: 2024-07-11, 12:14 UTC Spaces should only be recognized as such if the are quoted.
No.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *ghisler(Author) »

This should be fixed in Total Commander 11.50 beta 1, please check it!
17.07.24 Fixed: Find files: Ignore any leading and trailing spaces in wildcard searches except when they are in double quotes, e.g. *.txt *.docx now needs to be "*.txt " *.docx (32/64)
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5747
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *white »

Tested OK using TC 11.50b1 32-bit.
One issue remains when using TC 11.50b1 64-bit: the issue when with leading spaces.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] Search for \ and leading and trailing spaces

Post by *ghisler(Author) »

Confirmed, although I copied the code to 64-bit it behaves differently.
Author of Total Commander
https://www.ghisler.com
Post Reply