misc/CONTRIBUTING.md | 2 ++ src/nnn.c | 9 ++------- diff --git a/misc/CONTRIBUTING.md b/misc/CONTRIBUTING.md index cd305a93b7c356e9b0d985c138de0eafbc90783d..4fd61cd47eef38b5866a06b4c839417606811b89 100644 --- a/misc/CONTRIBUTING.md +++ b/misc/CONTRIBUTING.md @@ -7,6 +7,8 @@ ## Coding standard `nnn` follows the Linux kernel coding style closely. The C source code uses TABs and the plugins use 4 spaces for indentation. +Changes should not break the patch framework. Please run `make checkpatches` before raising a PR. + CI runs `shellcheck` on plugins. Please watch out for any failures if you are modifying/adding a plugin. ## Resources diff --git a/src/nnn.c b/src/nnn.c index 5344ebfaf1bb8f70520943396549c4df4c5fbe45..18e4c601d086c5d7a39e1c4c8f9aab6bb89cdbd3 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1113,11 +1113,7 @@ size_t len = 0; if (name[0] != '/') { // NOLINT /* Handle root case */ - if (istopdir(dir)) - len = 1; - else - len = xstrsncpy(out, dir, PATH_MAX); - + len = istopdir(dir) ? 1 : xstrsncpy(out, dir, PATH_MAX); out[len - 1] = '/'; // NOLINT } return (xstrsncpy(out + len, name, PATH_MAX - len) + len); @@ -2440,8 +2436,7 @@ } static void opstr(char *buf, char *op) { - snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c '%s \"$0\" \"$@\" . < /dev/tty' < %s", - op, selpath); + snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c '%s \"$0\" \"$@\" . < /dev/tty' < %s", op, selpath); } static bool rmmulstr(char *buf)