summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/main.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/core/apps/embeddedkonsole/main.cpp b/core/apps/embeddedkonsole/main.cpp
index 167b009..91199eb 100644
--- a/core/apps/embeddedkonsole/main.cpp
+++ b/core/apps/embeddedkonsole/main.cpp
@@ -31,2 +31,5 @@
31 31
32#include <pwd.h>
33#include <sys/types.h>
34
32 35
@@ -50,9 +53,18 @@ int main(int argc, char* argv[])
50 const char* shell = getenv("SHELL"); 53 const char* shell = getenv("SHELL");
51 if (shell == NULL || *shell == '\0') 54
55 if (shell == NULL || *shell == '\0') {
56 struct passwd *ent = 0;
57 uid_t me = getuid();
52 shell = "/bin/sh"; 58 shell = "/bin/sh";
59
60 while ( (ent = getpwent()) != 0 ) {
61 if (ent->pw_uid == me) {
62 if (ent->pw_shell != "")
63 shell = ent->pw_shell;
64 break;
65 }
66 }
67 endpwent();
68 }
53 69
54 // sh is completely broken on familiar. Let's try to get something better
55 if ( qstrcmp( shell, "/bin/shell" ) == 0 && QFile::exists( "/bin/bash" ) )
56 shell = "/bin/bash";
57
58 if( putenv((char*)"COLORTERM=") !=0) 70 if( putenv((char*)"COLORTERM=") !=0)