mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
Address lint reports
This commit is contained in:
parent
2bb76a0e38
commit
e7b0974551
12
src/nnn.c
12
src/nnn.c
|
@ -1235,7 +1235,7 @@ static char *abspath(const char *filepath, char *cwd, char *buf)
|
|||
cwd = home;
|
||||
path += 2; /* advance 2 bytes past the "~/" */
|
||||
} else if ((path[0] != '/') && !cwd) {
|
||||
cwd = getcwd(NULL, 0);
|
||||
cwd = getcwd(NULL, 0); // NOLINT
|
||||
if (!cwd)
|
||||
return NULL;
|
||||
allocated = TRUE;
|
||||
|
@ -2474,7 +2474,7 @@ static int spawn(char *file, char *arg1, char *arg2, char *arg3, ushort_t flag)
|
|||
|
||||
if (flag & F_NOSTDIN)
|
||||
dup2(fd, STDIN_FILENO);
|
||||
dup2(fd, STDOUT_FILENO);
|
||||
dup2(fd, STDOUT_FILENO); // NOLINT
|
||||
dup2(fd, STDERR_FILENO);
|
||||
close(fd);
|
||||
} else if (flag & F_TTY) {
|
||||
|
@ -4781,7 +4781,7 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
|
|||
return FALSE;
|
||||
}
|
||||
/* Copy the new dir path to open it in smart context */
|
||||
outdir = getcwd(NULL, 0);
|
||||
outdir = getcwd(NULL, 0); // NOLINT
|
||||
x_to = TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -6829,7 +6829,7 @@ static bool browse(char *ipath, const char *session, int pkey)
|
|||
/* If the initial path is a file, retain a way to return to start dir */
|
||||
if (g_state.initfile) {
|
||||
free(initpath);
|
||||
initpath = ipath = getcwd(NULL, 0);
|
||||
initpath = ipath = getcwd(NULL, 0); // NOLINT
|
||||
}
|
||||
path = g_ctx[0].c_path; /* current directory */
|
||||
|
||||
|
@ -8577,7 +8577,7 @@ int main(int argc, char *argv[])
|
|||
mmask_t mask;
|
||||
char *middle_click_env = xgetenv(env_cfg[NNN_MCLICK], "\0");
|
||||
|
||||
middle_click_key = (middle_click_env[0] == '^' && middle_click_env[1])
|
||||
middle_click_key = ((middle_click_env[0] == '^') && middle_click_env[1])
|
||||
? CONTROL(middle_click_env[1])
|
||||
: (uchar_t)middle_click_env[0];
|
||||
#endif
|
||||
|
@ -8828,7 +8828,7 @@ int main(int argc, char *argv[])
|
|||
/* Start in the current directory */
|
||||
char *startpath = getenv("PWD");
|
||||
|
||||
initpath = (startpath && *startpath) ? xstrdup(startpath) : getcwd(NULL, 0);
|
||||
initpath = (startpath && *startpath) ? xstrdup(startpath) : getcwd(NULL, 0); // NOLINT
|
||||
if (!initpath)
|
||||
initpath = "/";
|
||||
} else { /* Open a file */
|
||||
|
|
Loading…
Reference in a new issue