stat and check it's a dir before cd'ing. #7196

svn path=/trunk/kdebase/konsole/; revision=59569
wilder-portage
David Faure 26 years ago
parent 80a655516c
commit 9344a3f23d
  1. 8
      src/konsole_part.C

@ -31,6 +31,7 @@
#include <kiconloader.h>
#include <kdebug.h>
#include <qlabel.h>
#include <qfile.h>
#include <qsplitter.h>
#include <qdom.h>
@ -196,6 +197,13 @@ bool konsolePart::openURL( const KURL & url )
if ( url.isLocalFile() )
{
struct stat buff;
stat( QFile::encodeName( url.path() ), &buff );
if ( !S_ISDIR( buff.st_mode ) )
{
emit canceled( QString::null );
return false;
}
QString text = url.path();
text.replace(QRegExp(" "), "\\ "); // escape spaces
text = QString::fromLatin1("cd ") + text + '\n';

Loading…
Cancel
Save