aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-24 21:45:02 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-24 21:45:02 +0530
commit277f156c370bfca23ec87e41bf42ff2a37f7eb6d (patch)
treee8c71e626a765ce8c830bf8b3cdba51fe7198b61 /src/nnn.c
parent2934db3482931627f9a1a884f3a03fba643abf40 (diff)
downloadnnn-277f156c370bfca23ec87e41bf42ff2a37f7eb6d.tar.gz
Fix #291
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 9218838..b00b902 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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;
}