aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-04-01 22:51:55 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-04-01 22:51:55 +0530
commit1653414039fdf9b8f2685ebb013bd929c3f9fc1c (patch)
tree01964ab6a916159baacec7b9c691e20946c477fd
parentf2faa2ff128784d26b962a8199b5dafefb80d878 (diff)
downloadnnn-1653414039fdf9b8f2685ebb013bd929c3f9fc1c.tar.gz
Add more phony targets
-rw-r--r--Makefile2
-rw-r--r--nnn.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 7b97a90..95994c9 100644
--- a/Makefile
+++ b/Makefile
@@ -58,4 +58,4 @@ dist:
clean:
$(RM) -f $(BIN) nnn-$(VERSION).tar.gz
-.PHONY: all debug install uninstall strip dist clean
+.PHONY: $(BIN) $(SRC) all debug install uninstall strip dist clean
diff --git a/nnn.c b/nnn.c
index f057885..8fb57b3 100644
--- a/nnn.c
+++ b/nnn.c
@@ -331,14 +331,12 @@ crc8init()
uint dividend;
/* Compute the remainder of each possible dividend */
- for (dividend = 0; dividend < CRC8_TABLE_LEN; ++dividend)
- {
+ for (dividend = 0; dividend < CRC8_TABLE_LEN; ++dividend) {
/* Start with the dividend followed by zeros */
remainder = dividend << (WIDTH - 8);
/* Perform modulo-2 division, a bit at a time */
- for (bit = 8; bit > 0; --bit)
- {
+ for (bit = 8; bit > 0; --bit) {
/* Try to divide the current data bit */
if (remainder & TOPBIT)
remainder = (remainder << 1) ^ POLYNOMIAL;
@@ -360,8 +358,7 @@ crc8fast(uchar const message[], size_t n)
/* Divide the message by the polynomial, a byte at a time */
- for (byte = 0; byte < n; ++byte)
- {
+ for (byte = 0; byte < n; ++byte) {
data = message[byte] ^ (remainder >> (WIDTH - 8));
remainder = crc8table[data] ^ (remainder << 8);
}
@@ -908,6 +905,7 @@ getmime(const char *file)
for (i = 0; i < len; ++i) {
if (regcomp(&regex, assocs[i].regex, REG_NOSUB | REG_EXTENDED | REG_ICASE) != 0)
continue;
+
if (regexec(&regex, file, 0, NULL, 0) == 0) {
regfree(&regex);
return assocs[i].mime;
@@ -932,6 +930,7 @@ setfilter(regex_t *regex, char *filter)
regerror(r, regex, g_buf, len);
printmsg(g_buf);
}
+
return r;
}
@@ -1330,7 +1329,7 @@ readinput(void)
* Updates out with "dir/name or "/name"
* Returns the number of bytes copied including the terminating NULL byte
*/
-size_t
+static size_t
mkpath(char *dir, char *name, char *out, size_t n)
{
static size_t len;