In case the user supplied a wrong commandline, the Terminal didn't launch

the shell as the code would seem to do. I've disabled showing the Alert, 
since system() doesn't return the return value of "alert".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21809 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2007-08-03 10:47:27 +00:00
parent 2b87a97ac6
commit ce10f265de
+6 -3
View File
@@ -557,14 +557,17 @@ Shell::_Spawn(int row, int col, const char *command, const char *encoding)
* Exec failed. * Exec failed.
*/ */
sleep(1); sleep(1);
const char *spawnAlertMessage = "alert --stop " /*const char *spawnAlertMessage = "alert --stop "
"'Cannot execute \"%s\":\n" "'Cannot execute \"%s\":\n"
"\t%s\n'" "\t%s' "
"'Use Default Shell' 'Abort'"; "'Use Default Shell' 'Abort'";
char errorMessage[256]; char errorMessage[256];
snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, commandLine, strerror(errno)); snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, commandLine, strerror(errno));
if (system(errorMessage) == 0) // TODO: I'm not sure that system should return the return value of alert.
// At least, it's not doing that right now.
int returnValue = system(errorMessage);
if (returnValue == 0)*/
execl("/bin/sh", "/bin/sh", "-login", NULL); execl("/bin/sh", "/bin/sh", "-login", NULL);
exit(1); exit(1);