Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
16233a4b
Commit
16233a4b
authored
Feb 09, 2012
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Pty.cpp
View file @
16233a4b
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment