From ce10f265de398530c8412598f9879a1ed33a8913 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 3 Aug 2007 10:47:27 +0000 Subject: [PATCH] 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 --- src/apps/terminal/Shell.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index 4ab4f7cb4e..208dc20de1 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -557,14 +557,17 @@ Shell::_Spawn(int row, int col, const char *command, const char *encoding) * Exec failed. */ sleep(1); - const char *spawnAlertMessage = "alert --stop " + /*const char *spawnAlertMessage = "alert --stop " "'Cannot execute \"%s\":\n" - "\t%s\n'" + "\t%s' " "'Use Default Shell' 'Abort'"; char errorMessage[256]; 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); exit(1);