浏览代码

Code reduction

master
Arun Prakash Jana 5 年前
父节点
当前提交
defc1965ee
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 9 次插入14 次删除
  1. +9
    -14
      src/nnn.c

+ 9
- 14
src/nnn.c 查看文件

@@ -4017,17 +4017,10 @@ static bool remote_mount(char *newpath)
return FALSE; return FALSE;
} }


/* Convert "Host" to "Host:" */ char *div = strchr(tmp, ':');
size_t len = xstrlen(tmp); if (div)
bool path = FALSE; *div = '\0';

for (size_t count = 0; count < len; ++count)
if (tmp[count] == ':') {
tmp[count] = '\0';
len = count;
path = TRUE;
break;
}


/* Create the mount point */ /* Create the mount point */
mkpath(cfgpath, toks[TOK_MNT], mntpath); mkpath(cfgpath, toks[TOK_MNT], mntpath);
@@ -4037,10 +4030,12 @@ static bool remote_mount(char *newpath)
return FALSE; return FALSE;
} }


tmp[len] = ':'; if (!div) { /* Convert "host" to "host:" */
size_t len = xstrlen(tmp);
if (!path) /* Append ':' at the end */ tmp[len] = ':';
tmp[len + 1] = '\0'; tmp[len + 1] = '\0';
} else
*div = ':';


/* Connect to remote */ /* Connect to remote */
if (opt == 's') { if (opt == 's') {


||||||
x
 
000:0
正在加载...
取消
保存