Fla$her wrote: 2022-11-02, 16:43 UTC
And what good is leaving such a bug?
Agreed.
There are 2 issues mentioned in topic start:
Issue 1: Handling of Lister's filename parameter if the passed parameter ends with a dot
It's nice that since version 9.0, TC can properly view, rename and delete files in the file panel even when there are files ending with a dot. For example, if in a folder the files "file" and "file." exist, TC can properly view, rename and delete them both.
It seems this was solved by letting the internal Lister function interpret a dot at the end of a passed filename literally.
However, not only is the filename parameter interpreted this way when the Lister function is called internally, but also when Lister is called externally by using TC's command line parameter S=L or by using internal commands cm_List*.
This broke compatibility. Also, TC expects associated programs and external editors and viewers
not to interpret a trailing dot literally, but TC's own Lister can no longer do so.
It would be nice if Lister supports both methods of interpreting filenames ending with a dot. Not at the same time, but each of these methods separately when explicitly chosen. Not only to solve the issue with Associations mentioned in topic start, but also when Lister is used in combination with other programs where some of these programs add a dot to the filename (when a filename doesn't have a filename extension) and others don't. This could be implemented by adding another /S=L: option.
It would also be nice if, in addition to above, the user can control whether TC adds a dot to filenames without filename extension. TC is inconsistent in that it adds a dot when calling associated programs or external editor/viewer, but does not do so when a file is dragged and dropped on a button or when TC replaces special variables like %N used in button bar etc. A solution could be to allow another modifier in the command fields, similar to the modifiers * and **. Perhaps a more flexible syntax should be introduced. For example (?<modifiers>), similar to the inline regular expression modifiers which can enable or disable certain behaviors.
Issue 2: Bug in Internal Associations when matching filenames without filename extension
Suppose there is a file named "file" on your drive. The property tc.fullname has value "file". And the string "file" is used to match against a search/file type.
If you, for example, search on the condition "tc.fullname = file" using the Plugins tab, TC finds the file.
And TC also finds the file if you search for regular expression ^[^.]+$
When defining an internal association using one of the above searches/file types, the search is done correctly to determine the icon that appears in the file list, but
not to determine which program should be launched. The latter adds a dot to the filename before trying to match the filename with a file type. So in the latter case, the property tc.fullname has value "file." and no longer matches the condition "tc.fullname = file". And the filename "file." doesn't match with the regular expression ^[^.]+$