file name containing spaces aren't properly handled

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

fixdamnbug
Junior Member
Junior Member
Posts: 5
Joined: 2012-07-29, 09:33 UTC

file name containing spaces aren't properly handled

Post by *fixdamnbug »

when an external viewer is called. File names shall be escaped before calling an external application otherwise they aren't interpreted as one parameter but many.


this very old bug aren't getting fixed for years as I see and I was too lazy to register on this damn board that doesn't accept gmail accounts.
User avatar
Kishiro
Junior Member
Junior Member
Posts: 23
Joined: 2005-03-19, 00:01 UTC
Location: Norway

Post by *Kishiro »

I've never had this problem. I use an external viewer, and an external editor for that matter and I never had any problems with filenames containing spaces...
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2fixdamnbug
I don't have that problem either.

How do you call the external viewer, and wich viewer(s) is it?
this damn board that doesn't accept gmail accounts.
It is actually the other way around - gmail accounts doesn't accept mails from this board, that is why they are disabled.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

fixdamnbug, all names with spaces must be enclosed with double quotes. I tested it just now with Notepad.exe as an external viewer (have chosen its path in configuration dialog), TC passes correct quoted name if path contains spaces, so I can't confirm any bug here. So petermad's question is correct - which viewer do you use?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6482
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: file name containing spaces aren't properly handled

Post by *Horst.Epp »

fixdamnbug wrote:when an external viewer is called. File names shall be escaped before calling an external application otherwise they aren't interpreted as one parameter but many.


this very old bug aren't getting fixed for years as I see and I was too lazy to register on this damn board that doesn't accept gmail accounts.
Sorry but I think you are the only one having such a problem.
I've used external viewers since many years and never had any problem with file names or path containing spaces. Currently I've configired Universal viewer for this.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

MVV wrote:TC passes correct quoted name if path contains spaces...
Not always true.
E.g. if you call Notepad with commandline parameter

Code: Select all

C:\Windows\notepad.exe  /A
the filepath parameter is given as short name without quotes.

But one may easily work around this by explicitly qouting the parameter:

Code: Select all

C:\Windows\notepad.exe  /A  "%1"
Regards
Holger
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

if you call Notepad with commandline parameter
Code:
C:\Windows\notepad.exe /A
the filepath parameter is given as short name without quotes.
This happens because TC tries to detect whether the configured editor is 16-bit or 32-bit. This function fails because of the extra parameter, therefore TC assumes that it's a 32-bit program, and passes the short 8.3 name to it.
Author of Total Commander
https://www.ghisler.com
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

ghisler(Author) wrote: This happens because TC tries to detect whether the configured editor is 16-bit or 32-bit. This function fails because of the extra parameter, therefore TC assumes that it's a 32-bit program, and passes the short 8.3 name to it.
Some thoughts:
- Isn't it the other way around: "Short names for 16 bit applications"?
- Are there any 16 bit applications usable under 64 bit Windows?
- What happens if the user set "NtfsDisable8dot3NameCreation" to 1?

Just tested the last point with Win7 x64 virtual machine and TC8.0 x64:
"File not found" because the filename wasn't quoted.

Regards
Holger
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This isn't TC's fault. Use a better editor.
Author of Total Commander
https://www.ghisler.com
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

ghisler(Author) wrote:This isn't TC's fault. Use a better editor.
Forgot to mention that i did the previous test with the following external viewer configuration:

Code: Select all

%COMMANDER_PATH%\Totalcmd.exe /N /S=L
:wink:

Anyway, as mentioned before the user can fix it:

Code: Select all

%COMMANDER_PATH%\Totalcmd.exe /N /S=L "%1"
Regards
Holger
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The above should still work with the 8.3 name, though...
Author of Total Commander
https://www.ghisler.com
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Not if NtfsDisable8dot3NameCreation is set to 1

Unfortunately only fixdamnbug (who seems not to participate in this thread any more) is the only one who may confirm that this kind of configuration of external viewer and NtfsDisable8dot3NameCreation is the reason for his complains.

Regards
Holger
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed when you disable 8.3 names, you have to use the "%1" parameter explicitly, or an editor without parameters.
Author of Total Commander
https://www.ghisler.com
fixdamnbug
Junior Member
Junior Member
Posts: 5
Joined: 2012-07-29, 09:33 UTC

Post by *fixdamnbug »

please take a look at this damn picture and tell me what would be the right syntax to make it work with filenames with spaces

HERE SHOULD BE THE LINK TO THE DAMN PICTURE BUT

In order to try to prevent spammers, we do not allow our users to post URLs in any form until they have posted at least 1 legitimate posts and have been with us for more than 1 days. We appreciate your understanding in this matter in order to help us eliminate spam from this forum. If you have somehow gotten this message even though you meet both of the criteria, please let us know ASAP.
fixdamnbug
Junior Member
Junior Member
Posts: 5
Joined: 2012-07-29, 09:33 UTC

Post by *fixdamnbug »

you see why it makes me mad?

let's try it this way
img17.imageshack.us/img17/5396/externalassoc.png
Post Reply