mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Do not add a trailing / if there is nothing to follow it, Johannes
Altmanninger in GitHub issue 4472.
This commit is contained in:
5
spawn.c
5
spawn.c
@ -231,8 +231,9 @@ spawn_pane(struct spawn_context *sc, char **cause)
|
|||||||
if (sc->cwd != NULL) {
|
if (sc->cwd != NULL) {
|
||||||
cwd = format_single(item, sc->cwd, c, target->s, NULL, NULL);
|
cwd = format_single(item, sc->cwd, c, target->s, NULL, NULL);
|
||||||
if (*cwd != '/') {
|
if (*cwd != '/') {
|
||||||
xasprintf(&new_cwd, "%s/%s", server_client_get_cwd(c,
|
xasprintf(&new_cwd, "%s%s%s",
|
||||||
target->s), cwd);
|
server_client_get_cwd(c, target->s),
|
||||||
|
*cwd != '\0' ? "/" : "", cwd);
|
||||||
free(cwd);
|
free(cwd);
|
||||||
cwd = new_cwd;
|
cwd = new_cwd;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user