file name containing spaces aren't properly handled

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Fix it yourself and try:

Code: Select all

C:\Windows\System32\WScript.exe "C:\Alex\Bat\unpack.js" "%1"
HTH
Holger
Last edited by HolgerK on 2012-08-14, 09:50 UTC, edited 2 times in total.
User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2fixdamnbug
http://img17.imageshack.us/img17/5396/externalassoc.png

What is the content of your unpack.js ? I assume that it is some kind of script or batch file - not a binary...
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
fixdamnbug
Junior Member
Junior Member
Posts: 5
Joined: 2012-07-29, 09:33 UTC

Post by *fixdamnbug »

petermad wrote:2fixdamnbug
http://img17.imageshack.us/img17/5396/externalassoc.png

What is the content of your unpack.js ? I assume that it is some kind of script or batch file - not a binary...
an attempt at humor, I suppose? Why on earth should it make a difference?
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

fixdamnbug wrote:Why on earth should it make a difference?
Because:
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 16-bit program, and passes the short 8.3 name to it.
This detection may also fail if you use a script instead of an executable program!

And because it seems that you configured your windows system with:
HolgerK wrote:NtfsDisable8dot3NameCreation is set to 1
Which in consequence leads to:
ghisler(Author) wrote:Indeed when you disable 8.3 names, you have to use the "%1" parameter explicitly, or an editor(not a script!) without parameters.
So the remaining question is:
- Did you disable 8.3 names?
- Does it work with the command:
C:\Alex\Bat\unpack.js "%1"
?

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

Post by *fixdamnbug »

HolgerK wrote: - Did you disable 8.3 names?
- Does it work with the command:
C:\Alex\Bat\unpack.js "%1"
?

yes
no
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Ah I see.
It works if you manually add a line to wincmd.ini like:

Code: Select all

[Extensions]
foo=C:\Holger\Script\test.vbs "%1"
or

Code: Select all

[Extensions]
foo=C:\Holger\Script\test.vbs "%1" ^.foo
But using the "Configuration>Edit/View>Associations.." dialog and pasting the line

Code: Select all

C:\Holger\Script\test.vbs "%1"
as "Associate with:" command, the configuration in wincmd.ini is stored as:

Code: Select all

[Extensions]
foo=C:\Holger\Script\test.vbs " ^.foo
(TC8.01 x64 and x86)

So you are right: there is a bug.

Regards
Holger
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Confirm that TC saves wrong string to INI, but loads manually written one correctly.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It's actually Windows which cuts off the double quotes in the ini functions...
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 »

The strange thing is that
C:\Holger\Script\test.vbs "%2"
is stored without any problem...

Regards
Holger
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Tested it now with above mentioned string, Windows stores it correctly in INI.

Code: Select all

WritePrivateProfileString("111", "222", "C:\\Holger\\Script\\test.vbs \"%1\"", "F:\\1.ini");
AFAIK Windows always stores strings in a way that will allow to read the same string back (it may add quotes if necessary but not cut a part of string).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem exists when a string starts AND ends with a double quote, e.g.
"C:\Holger\Script\test.vbs" "%2"

Then reading the profile string will return just
C:\Holger\Script\test.vbs" "%2
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 »

Then reading the profile string will return just
Not confirmed.

I doubt that this has to do with qoutes.

The problem is that everything behind the substring %1 (including the substring itself) seems to be removed before the string is saved.

Code: Select all

C:\Holger\Script\test_%2_.vbs
->

Code: Select all

C:\Holger\Script\test_%2_.vbs

Code: Select all

C:\Holger\Script\test_%1_.vbs
->

Code: Select all

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

Post by *ghisler(Author) »

Just write it manually to the ini as
""C:\Holger\Script\test.vbs" "%2""
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:The problem exists when a string starts AND ends with a double quote, e.g.
"C:\Holger\Script\test.vbs" "%2"

Then reading the profile string will return just
C:\Holger\Script\test.vbs" "%2
...
Just write it manually to the ini as
""C:\Holger\Script\test.vbs" "%2""
As I wrote: I can't confirm (Win7 x64).

Neither non quoted, quoted or double quoted strings are the problem, nor reading is the problem.
The problem is the replacement of %1 _before_ TC writes the string to the ini file.
This works well for the default association (Viewer=) but not for the [Extensions] specific associations.

Regards
Holger
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author) wrote:The problem exists when a string starts AND ends with a double quote, e.g.
You can always add quotes before storing string so Windows will remove them on reading them back.

But HolgerK's reporting another problem.
Post Reply