commit e7b097455101377f5ede05c7966886acc8303786
parent 2bb76a0e38d0c2ad3b742609bc77fa7e119c7c00
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Tue, 24 Sep 2024 16:56:11 +0530
Address lint reports
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/nnn.c b/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 */