- Feb
- 17
- 0
Hi,
Two days ago I upgraded from TC 10.00.52 (I think) to 10.00.76. Since this upgrade I'm having the problem that the compspec variable is not parsed correctly if it contains spaces. The actual problem occurs by calling system() from my own C++ app but it can be simulated by typing the following from a TCC command line:
%comspec% dir
This fails with the error
TCC: Unknown command "D:\Program"
The error caused by the call to system() in the C++ app is actually different:
TCC: Unknown command "Files\JPSoft\TCMD10\TCC.EXE"
which I suppose has something to do with the number of arguments or something.
Of course in a command prompt or batch file I can simply put quotes around it like this:
"%comspec%" dir
and it will work fine but in my C++ program I'm simply calling it like this
system("dir");
hence I have no control over the way the comspec variable is passed to and parsed by TCC.
All this worked fine with TCC 10.00.52 so I assume something has changed since then.
I tried changing the definition for compspec from the default
D:\Program Files\JPSoft\TCMD10\TCC.EXE
to
"D:\Program Files\JPSoft\TCMD10\TCC.EXE"
but it does not make any difference, the quotes I added seem to get parsed out by TCC if you use it on the command prompt. The SET command does confirm that it is stored with quotes after this change.
Is this something that could be fixed with the next update? Or is there some other workaround?
Thanks,
Arjan
Two days ago I upgraded from TC 10.00.52 (I think) to 10.00.76. Since this upgrade I'm having the problem that the compspec variable is not parsed correctly if it contains spaces. The actual problem occurs by calling system() from my own C++ app but it can be simulated by typing the following from a TCC command line:
%comspec% dir
This fails with the error
TCC: Unknown command "D:\Program"
The error caused by the call to system() in the C++ app is actually different:
TCC: Unknown command "Files\JPSoft\TCMD10\TCC.EXE"
which I suppose has something to do with the number of arguments or something.
Of course in a command prompt or batch file I can simply put quotes around it like this:
"%comspec%" dir
and it will work fine but in my C++ program I'm simply calling it like this
system("dir");
hence I have no control over the way the comspec variable is passed to and parsed by TCC.
All this worked fine with TCC 10.00.52 so I assume something has changed since then.
I tried changing the definition for compspec from the default
D:\Program Files\JPSoft\TCMD10\TCC.EXE
to
"D:\Program Files\JPSoft\TCMD10\TCC.EXE"
but it does not make any difference, the quotes I added seem to get parsed out by TCC if you use it on the command prompt. The SET command does confirm that it is stored with quotes after this change.
Is this something that could be fixed with the next update? Or is there some other workaround?
Thanks,
Arjan