summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/consoleconfigwidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp
index a6ad8d2..27d9a3f 100644
--- a/noncore/apps/opie-console/consoleconfigwidget.cpp
+++ b/noncore/apps/opie-console/consoleconfigwidget.cpp
@@ -5,13 +5,13 @@
#include <qlistview.h>
#include <qhbox.h>
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>
-
+#include <unistd.h>
#include "consoleconfigwidget.h"
ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
const char* na )
: ProfileDialogConnectionWidget( name, parent, na ) {
@@ -68,18 +68,18 @@ ConsoleConfigWidget::~ConsoleConfigWidget() {
void ConsoleConfigWidget::load( const Profile& prof ) {
/*
* default to the users default shell
*/
struct passwd *ent = 0;
char *shell = "/bin/sh";
+ int uid = getuid();
- while ( (ent = getpwent()) != 0 ) {
+ ent = getpwuid(uid);
if (ent->pw_shell != "") {
shell = ent->pw_shell;
}
- }
m_cmd->setText(prof.readEntry("Command", shell ));
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), "");