mirror of
https://github.com/termux/termux-app
synced 2024-06-24 18:17:07 +00:00
Avoid trailing slash in CWD (fixes #1413)
This commit is contained in:
parent
b729085d52
commit
566d656c16
|
@ -348,10 +348,11 @@ public final class TerminalSession extends TerminalOutput {
|
|||
try {
|
||||
final String cwdSymlink = String.format("/proc/%s/cwd/", mShellPid);
|
||||
String outputPath = new File(cwdSymlink).getCanonicalPath();
|
||||
String outputPathWithTrailingSlash = outputPath;
|
||||
if (!outputPath.endsWith("/")) {
|
||||
outputPath += '/';
|
||||
outputPathWithTrailingSlash += '/';
|
||||
}
|
||||
if (!cwdSymlink.equals(outputPath)) {
|
||||
if (!cwdSymlink.equals(outputPathWithTrailingSlash)) {
|
||||
return outputPath;
|
||||
}
|
||||
} catch (IOException | SecurityException e) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user