aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 4465bdf..aa8ae4c 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4027,8 +4027,15 @@ static bool remote_mount(char *newpath)
/* Convert "Host" to "Host:" */
size_t len = xstrlen(tmp);
+ bool path = FALSE;
- if (tmp[len - 1] != ':') { /* Append ':' if missing */
+ for (size_t count = 0; count < len; ++count)
+ if (tmp[count] == ':') {
+ path = TRUE;
+ break;
+ }
+
+ if (!path) { /* Append ':' if missing */
tmp[len] = ':';
tmp[len + 1] = '\0';
}