Game Development Community

BUG / PATCH: switching projects fails

by Andy · in Torque Game Builder · 12/17/2006 (11:59 am) · 1 replies

When switching projects in the editor, TGB would disappear and there would be an error message from the shell (correctly) complaining that "./TGB.bin &" was not found. Now, I'm a tcsh user rather than a bash user, so maybe this doesn't happen for anyone else.

The problem is in Platform::restartInstance() having an extra set of quotes in the string that will be passed to system().

Here's the fix for it (relative to the 1.1.3 tree):

*** x86UNIXFileio.cc.orig	2006-08-05 10:01:52.000000000 -0700
--- x86UNIXFileio.cc	2006-12-16 10:28:37.608392792 -0800
***************
*** 1194,1200 ****
          }
  
          char cmd[MaxPath];
!         sprintf(cmd, "\"%s &\"", x86UNIXState->getExePathName());
          Con::printf("---- %s -----",cmd);
          if(!system(cmd))
          {
--- 1194,1201 ----
          }
  
          char cmd[MaxPath];
!         // sprintf(cmd, "\"%s &\"", x86UNIXState->getExePathName());
!         sprintf(cmd, "%s &", x86UNIXState->getExePathName());
          Con::printf("---- %s -----",cmd);
          if(!system(cmd))
          {

#1
12/17/2006 (5:17 pm)
Ooo, good catch, That was high up on my stuff to fix next :-)

Thanks,
Gary (-;