Commit 16233a4b authored by Jekyll Wu's avatar Jekyll Wu
Browse files

Remove trailing slash when settings initial working directory

BUG:293710
FIXED-IN: 2.8.1
(cherry picked from commit fdca5195)
parent a4e9eaad
......@@ -133,11 +133,19 @@ char Pty::eraseChar() const
void Pty::setInitialWorkingDirectory(const QString& dir)
{
setWorkingDirectory(dir);
QString pwd = dir;
// remove trailing slash in the path when appropriate
// example: /usr/share/icons/ ==> /usr/share/icons
if ( pwd.length() > 1 && pwd.at(pwd.length()-1) == QChar('/') ) {
pwd.truncate(pwd.length()-1);
}
setWorkingDirectory(pwd);
// setting PWD to "." will cause problem for bash & zsh
if ( dir != "." )
setEnv("PWD", dir);
if (pwd != ".")
setEnv("PWD", pwd);
}
void Pty::addEnvironmentVariables(const QStringList& environment)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment