Kaynağa Gözat

Code reduction

master
Arun Prakash Jana 4 yıl önce
ebeveyn
işleme
defc1965ee
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: A75979F35C080412
1 değiştirilmiş dosya ile 9 ekleme ve 14 silme
  1. +9
    -14
      src/nnn.c

+ 9
- 14
src/nnn.c Dosyayı Görüntüle

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

/* Convert "Host" to "Host:" */
size_t len = xstrlen(tmp);
bool path = FALSE;

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

if (div)
*div = '\0';

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

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

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


||||||
x
 
000:0
Yükleniyor…
İptal
Kaydet