Skip to content

Commit

Permalink
Address lint reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Sep 24, 2024
1 parent 2bb76a0 commit e7b0974
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit e7b0974

Please sign in to comment.