Fix kdesudo hang when no arguments are provided

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesudo@1248417 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent e5b073adf7
commit e3a580bb5d

@ -37,8 +37,8 @@
static const char *description =
I18N_NOOP("KdeSudo");
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
static KCmdLineOptions options[] =
{
{ "u <runas>", I18N_NOOP("sets a runas user"), 0 },
@ -93,6 +93,10 @@ int main(int argc, char **argv)
executable = commandlist[0];
}
}
else {
kdError() << I18N_NOOP("You must provide the name of the executable you want to run as an argument to kdesudo") << endl;
exit(1);
}
/* We have to make sure the executable is only the binary name */
executableList = TQStringList::split(" ", executable);
@ -102,7 +106,7 @@ int main(int argc, char **argv)
int i = executableList.count() - 1;
executable = executableList[i];
/* Kubuntu has a bug in it - this is a workaround for it */
/* Kubuntu has a bug in it - this is a workaround for it */
KGlobal::dirs()->addResourceDir("apps","/usr/share/applications/kde");
KGlobal::dirs()->addResourceDir("apps","/usr/share/applications");

Loading…
Cancel
Save