瀏覽代碼

Show debug info under DPRINTF

master
Arun Prakash Jana 5 年之前
父節點
當前提交
7c223758ac
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: A75979F35C080412
共有 1 個文件被更改,包括 12 次插入24 次删除
  1. +12
    -24
      src/nnn.c

+ 12
- 24
src/nnn.c 查看文件

@@ -442,15 +442,13 @@ static const char * const env_cfg[] = {
};

/* Required env vars */
#define PWD 0
#define SHELL 1
#define SHLVL 2
#define VISUAL 3
#define EDITOR 4
#define PAGER 5
#define SHELL 0
#define SHLVL 1
#define VISUAL 2
#define EDITOR 3
#define PAGER 4

static const char * const envs[] = {
"PWD",
"SHELL",
"SHLVL",
"VISUAL",
@@ -2328,23 +2326,6 @@ static bool show_help(char *path)
dprintf(fd, "%s: 1\n", env_cfg[i]);
}

dprintf(fd, "\n");

start = getenv(envs[PWD]);
if (start)
dprintf(fd, "%s: %s\n", envs[PWD], start);
if (getenv(envs[SHELL]))
dprintf(fd, "%s: %s %s\n", envs[SHELL], shell, shell_arg);
start = getenv(envs[SHLVL]);
if (start)
dprintf(fd, "%s: %s\n", envs[SHLVL], start);
if (getenv(envs[VISUAL]))
dprintf(fd, "%s: %s\n", envs[VISUAL], editor);
else if (getenv(envs[EDITOR]))
dprintf(fd, "%s: %s\n", envs[EDITOR], editor);
if (getenv(envs[PAGER]))
dprintf(fd, "%s: %s %s\n", envs[PAGER], pager, pager_arg);

dprintf(fd, "\nv%s\n%s\n", VERSION, GENERAL_INFO);
close(fd);

@@ -3943,14 +3924,21 @@ int main(int argc, char *argv[])

/* Get VISUAL/EDITOR */
editor = xgetenv(envs[VISUAL], xgetenv(envs[EDITOR], "vi"));
DPRINTF_S(editor);

/* Get PAGER */
pager = xgetenv(envs[PAGER], "less");
getprogarg(pager, &pager_arg);
DPRINTF_S(pager);
DPRINTF_S(pager_arg);

/* Get SHELL */
shell = xgetenv(envs[SHELL], "sh");
getprogarg(shell, &shell_arg);
DPRINTF_S(shell);
DPRINTF_S(shell_arg);

DPRINTF_S(getenv("PWD"));

/* Setup script execution */
scriptpath = getenv(env_cfg[NNN_SCRIPT]);


Loading…
取消
儲存