diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-06-24 21:45:02 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-06-24 21:45:02 +0530 |
commit | 277f156c370bfca23ec87e41bf42ff2a37f7eb6d (patch) | |
tree | e8c71e626a765ce8c830bf8b3cdba51fe7198b61 /src/nnn.c | |
parent | 2934db3482931627f9a1a884f3a03fba643abf40 (diff) | |
download | nnn-277f156c370bfca23ec87e41bf42ff2a37f7eb6d.tar.gz |
Fix #291
Diffstat (limited to 'src/nnn.c')
-rw-r--r-- | src/nnn.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -2569,8 +2569,14 @@ static bool create_dir(const char *path) static bool sshfs_mount(char *path, char *newpath, int *presel) { + uchar flag = F_NORMAL; int r; - char *tmp; + char *tmp, *env, *cmd = "sshfs"; + + if (!getutil(cmd)) { + printwait("sshfs missing", presel); + return FALSE; + } tmp = xreadline(NULL, "host: "); if (!tmp[0]) @@ -2583,18 +2589,19 @@ static bool sshfs_mount(char *path, char *newpath, int *presel) return FALSE; } - if (!getutil("sshfs")) { - printwait("sshfs missing", presel); - return FALSE; - } - /* Convert "Host" to "Host:" */ r = strlen(tmp); tmp[r] = ':'; tmp[r + 1] = '\0'; + env = getenv("NNN_SSHFS_OPTS"); + if (env) + flag |= F_MULTI; + else + env = cmd; + /* Connect to remote */ - if (spawn("sshfs", tmp, newpath, NULL, F_NORMAL)) { + if (spawn(env, tmp, newpath, NULL, flag)) { printwait("mount failed", presel); return FALSE; } |