summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index b0f0275..c3c58be 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -291,7 +291,22 @@ void MyPty::close() {
}
void MyPty::reload( const Profile& prof) {
m_env.clear();
- m_cmd = prof.readEntry("Command", "/bin/bash");
+ m_cmd = prof.readEntry("Command", "/bin/sh");
+
+ /*
+ * Lets check if m_cmd actually
+ * exists....
+ * we try to use bin/bash and if
+ * this fails we
+ * will fallback to /bin/sh
+ * which should be there 100%
+ */
+ if ( !QFile::exists(QFile::encodeName(m_cmd) ) )
+ if (QFile::exists("/bin/bash") )
+ m_cmd = "/bin/bash";
+ else
+ m_cmd = "/bin/sh";
+
int envcount = prof.readNumEntry("EnvVars", 0);
for (int i=0; i<envcount; i++) {
QString name = prof.readEntry("Env_Name_" + QString::number(i), "");