Fix run tdesu with empty command

This relates to Bug 1494
pull/2/head
Slávek Banko 11 years ago
parent 7bf342b15f
commit 21cc8cea31

@ -158,7 +158,7 @@ static int startApp()
TQString icon;
if ( args->isSet("i"))
icon = args->getOption("i");
icon = args->getOption("i");
bool prompt = true;
if ( args->isSet("d"))
@ -218,33 +218,24 @@ static int startApp()
}
// Get command
if (args->isSet("c"))
{
if (args->isSet("c")) {
command = args->getOption("c");
for (int i=0; i<args->count(); i++)
{
TQString arg = TQFile::decodeName(args->arg(i));
KRun::shellQuote(arg);
command += " ";
command += TQFile::encodeName(arg);
}
}
else
{
if( args->count() == 0 )
{
TDECmdLineArgs::usage(i18n("No command specified."));
exit(1);
}
command = args->arg(0);
for (int i=1; i<args->count(); i++)
{
TQString arg = TQFile::decodeName(args->arg(i));
KRun::shellQuote(arg);
command += " ";
command += TQFile::encodeName(arg);
else {
if( args->count() ) {
command = args->arg(0);
}
}
if (command.stripWhiteSpace().isEmpty()) {
TDECmdLineArgs::usage(i18n("No command specified."));
exit(1);
}
for (int i= args->isSet("c") ? 0 : 1; i<args->count(); i++) {
TQString arg = TQFile::decodeName(args->arg(i));
KRun::shellQuote(arg);
command += " ";
command += TQFile::encodeName(arg);
}
// Don't change uid if we're don't need to.
if (!change_uid)

Loading…
Cancel
Save