From 9344a3f23df7f6cece0cd6d3e8adc3f875c027e3 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 2 Aug 2000 17:55:04 +0000 Subject: [PATCH] stat and check it's a dir before cd'ing. #7196 svn path=/trunk/kdebase/konsole/; revision=59569 --- src/konsole_part.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/konsole_part.C b/src/konsole_part.C index bfd88266..52982186 100644 --- a/src/konsole_part.C +++ b/src/konsole_part.C @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -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';