summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-21 02:46:14 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-21 02:46:14 +0000
commite3a580bb5da4119c943bc2cf78ee944cf33e5cb1 (patch)
treeac127d944a03ce53a423953f22cff57e269478d0
parente5b073adf79440b7c9882736c02c9e4d4c68fa9a (diff)
downloadtdesudo-e3a580bb.tar.gz
tdesudo-e3a580bb.zip
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
-rw-r--r--kdesudo/main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/kdesudo/main.cpp b/kdesudo/main.cpp
index 6ef0074..f48943d 100644
--- a/kdesudo/main.cpp
+++ b/kdesudo/main.cpp
@@ -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");