ソースを参照

Code refactor

master
Arun Prakash Jana 6年前
コミット
85922c3139
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: A75979F35C080412
1個のファイルの変更2行の追加11行の削除
  1. +2
    -11
      src/nnn.c

+ 2
- 11
src/nnn.c ファイルの表示

@@ -736,10 +736,7 @@ static char *xbasename(char *path)
/* Writes buflen char(s) from buf to a file */ /* Writes buflen char(s) from buf to a file */
static void writecp(const char *buf, const size_t buflen) static void writecp(const char *buf, const size_t buflen)
{ {
if (cfg.pickraw) if (cfg.pickraw || !*g_cppath)
return;

if (!g_cppath[0])
return; return;


FILE *fp = fopen(g_cppath, "w"); FILE *fp = fopen(g_cppath, "w");
@@ -760,12 +757,6 @@ static void appendfpath(const char *path, const size_t len)
errexit(); errexit();
} }


/* Enabling the following will miss files with newlines */
/*
* if (copybufpos)
* pcopybuf[copybufpos - 1] = '\n';
*/

copybufpos += xstrlcpy(pcopybuf + copybufpos, path, len); copybufpos += xstrlcpy(pcopybuf + copybufpos, path, len);
} }


@@ -971,7 +962,7 @@ static void spawn(char *file, char *arg1, char *arg2, const char *dir, uchar fla
char *argv[EXEC_ARGS_MAX] = {0}; char *argv[EXEC_ARGS_MAX] = {0};
char *cmd = NULL; char *cmd = NULL;


if (!file || !file[0]) if (!file || !*file)
return; return;


/* Swap args if the first arg is NULL and second isn't */ /* Swap args if the first arg is NULL and second isn't */


||||||
x
 
000:0
読み込み中…
キャンセル
保存