mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-05 16:41:10 +01:00
Avoid trailing slash in CWD (fixes #1413)
This commit is contained in:
parent
b729085d52
commit
566d656c16
1 changed files with 3 additions and 2 deletions
|
|
@ -348,10 +348,11 @@ public final class TerminalSession extends TerminalOutput {
|
||||||
try {
|
try {
|
||||||
final String cwdSymlink = String.format("/proc/%s/cwd/", mShellPid);
|
final String cwdSymlink = String.format("/proc/%s/cwd/", mShellPid);
|
||||||
String outputPath = new File(cwdSymlink).getCanonicalPath();
|
String outputPath = new File(cwdSymlink).getCanonicalPath();
|
||||||
|
String outputPathWithTrailingSlash = outputPath;
|
||||||
if (!outputPath.endsWith("/")) {
|
if (!outputPath.endsWith("/")) {
|
||||||
outputPath += '/';
|
outputPathWithTrailingSlash += '/';
|
||||||
}
|
}
|
||||||
if (!cwdSymlink.equals(outputPath)) {
|
if (!cwdSymlink.equals(outputPathWithTrailingSlash)) {
|
||||||
return outputPath;
|
return outputPath;
|
||||||
}
|
}
|
||||||
} catch (IOException | SecurityException e) {
|
} catch (IOException | SecurityException e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue