]> Sergey Matveev's repositories - nnn.git/commitdiff
Make option O_NOLOC renamed to O_NOLC
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 24 May 2021 17:08:08 +0000 (22:38 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 24 May 2021 17:08:08 +0000 (22:38 +0530)
Makefile
misc/haiku/Makefile
src/nnn.c

index 645403839f67820898b13db345ab65e152848451..19cc3d6160a77f85971701c6bf97e744b32a9299 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ CFLAGS_OPTIMIZATION ?= -O3
 O_DEBUG := 0  # debug binary
 O_NORL := 0  # no readline support
 O_PCRE := 0  # link with PCRE library
-O_NOLOC := 0  # no locale support
+O_NOLC := 0  # no locale support
 O_NOMOUSE := 0  # no mouse support
 O_NOBATCH := 0  # no built-in batch renamer
 O_NOFIFO := 0  # no FIFO previewer support
@@ -34,9 +34,9 @@ endif
 ifneq ($(filter norl,$(MAKECMDGOALS)),)
        O_NORL := 1
 endif
-ifneq ($(filter noloc,$(MAKECMDGOALS)),)
+ifneq ($(filter nolc,$(MAKECMDGOALS)),)
        O_NORL := 1
-       O_NOLOC := 1
+       O_NOLC := 1
 endif
 
 ifeq ($(strip $(O_DEBUG)),1)
@@ -57,8 +57,8 @@ ifeq ($(strip $(O_PCRE)),1)
        LDLIBS += -lpcre
 endif
 
-ifeq ($(strip $(O_NOLOC)),1)
-       CPPFLAGS += -DNOLOCALE
+ifeq ($(strip $(O_NOLC)),1)
+       CPPFLAGS += -DNOLC
 endif
 
 ifeq ($(strip $(O_NOMOUSE)),1)
@@ -143,7 +143,7 @@ $(BIN): $(SRC) $(HEADERS)
 # targets for backwards compatibility
 debug: $(BIN)
 norl: $(BIN)
-noloc: $(BIN)
+nolc: $(BIN)
 
 install-desktop: $(DESKTOPFILE)
        $(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPPREFIX)
index 9f847ba9ecabf6dd322c98b88d2561245b670e0e..61cfe729f2940cfe891518ccc0434d9318d9564b 100644 (file)
@@ -12,7 +12,7 @@ CFLAGS_OPTIMIZATION ?= -O3
 O_DEBUG := 0  # debug binary
 O_NORL := 0  # no readline support
 O_PCRE := 0  # link with PCRE library
-O_NOLOC := 0  # no locale support
+O_NOLC := 0  # no locale support
 O_NOMOUSE := 0  # no mouse support
 O_NOBATCH := 0  # no built-in batch renamer
 O_NOFIFO := 0  # no FIFO previewer support
@@ -32,13 +32,13 @@ endif
 ifneq ($(filter norl,$(MAKECMDGOALS)),)
        O_NORL := 1
 endif
-ifneq ($(filter noloc,$(MAKECMDGOALS)),)
+ifneq ($(filter nolc,$(MAKECMDGOALS)),)
        O_NORL := 1
-       O_NOLOC := 1
+       O_NOLC := 1
 endif
 
 ifeq ($(strip $(O_DEBUG)),1)
-       CPPFLAGS += -DDBGMODE
+       CPPFLAGS += -DDEBUG
        CFLAGS += -g
        LDLIBS += -lrt
 endif
@@ -56,8 +56,8 @@ ifeq ($(strip $(O_PCRE)),1)
        LDLIBS += -lpcre
 endif
 
-ifeq ($(strip $(O_NOLOC)),1)
-       CPPFLAGS += -DNOLOCALE
+ifeq ($(strip $(O_NOLC)),1)
+       CPPFLAGS += -DNOLC
 endif
 
 ifeq ($(strip $(O_NOMOUSE)),1)
@@ -154,7 +154,7 @@ $(BIN): $(OBJS)
 # targets for backwards compatibility
 debug: $(BIN)
 norl: $(BIN)
-noloc: $(BIN)
+nolc: $(BIN)
 
 install: all
        $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
@@ -170,6 +170,7 @@ strip: $(BIN)
        $(STRIP) $^
 
 static:
+       # regular static binary
        make O_STATIC=1 strip
        mv $(BIN) $(BIN)-static
 
index 9d8abf98aac97895c512ae3b94030e308fc3f022..f7aae2350268b7b63a4af29dc3177c9bb7f30ca7 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -76,7 +76,7 @@
 #include <fcntl.h>
 #include <libgen.h>
 #include <limits.h>
-#ifndef NOLOCALE
+#ifndef NOLC
 #include <locale.h>
 #endif
 #include <stdio.h>
@@ -2447,7 +2447,7 @@ static int xstricmp(const char * const s1, const char * const s2)
        }
 
        /* Handle 1. all non-numeric and 2. both same numeric value cases */
-#ifndef NOLOCALE
+#ifndef NOLC
        return strcoll(s1, s2);
 #else
        return strcasecmp(s1, s2);
@@ -3470,7 +3470,7 @@ static void resetdircolor(int flags)
  * Adjust string length to maxcols if > 0;
  * Max supported str length: NAME_MAX;
  */
-#ifdef NOLOCALE
+#ifdef NOLC
 static char *unescape(const char *str, uint_t maxcols)
 {
        char * const wbuf = g_buf;
@@ -3813,7 +3813,7 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
        if (!ind)
                ++namecols;
 
-#ifndef NOLOCALE
+#ifndef NOLC
        addwstr(unescape(ent->name, namecols));
 #else
        addstr(unescape(ent->name, MIN(namecols, ent->nlen) + 1));
@@ -8012,7 +8012,7 @@ int main(int argc, char *argv[])
                return EXIT_FAILURE;
        }
 
-#ifndef NOLOCALE
+#ifndef NOLC
        /* Set locale */
        setlocale(LC_ALL, "");
 #ifdef PCRE