summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index c3c58be..23d4966 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -280,54 +280,52 @@ QString MyPty::name()const{
}
bool MyPty::open() {
if (m_fd < 0)
m_fd = openPty();
start();
return true;
}
void MyPty::close() {
donePty();
m_fd = openPty();
}
void MyPty::reload( const Profile& prof) {
m_env.clear();
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
+ if ( m_cmd.stripWhiteSpace() == "/bin/bash" && !QFile::exists(QFile::encodeName(m_cmd) ) )
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), "");
QString value = prof.readEntry("Env_Value_" + QString::number(i), "");
if (!(name.isEmpty() || value.isEmpty())) {
m_env.insert(name, value);
}
}
}
/*! sends len bytes through the line */
void MyPty::send(const QByteArray& ar)
{
#ifdef VERBOSE_DEBUG
// verbose debug
printf("sending bytes:\n");
for (uint i = 0; i < ar.count(); i++)
printf("%c", ar[i]);
printf("\n");
#endif
::write(m_fd, ar.data(), ar.count());
}
/*! indicates that a block of data is received */