From db8079f552621ed3b1274f52eb0fc7caa47e94a5 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 24 May 2021 22:38:08 +0530 Subject: [PATCH] Make option O_NOLOC renamed to O_NOLC --- Makefile | 12 ++++++------ misc/haiku/Makefile | 15 ++++++++------- src/nnn.c | 10 +++++----- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 64540383..19cc3d61 100644 --- 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) diff --git a/misc/haiku/Makefile b/misc/haiku/Makefile index 9f847ba9..61cfe729 100644 --- a/misc/haiku/Makefile +++ b/misc/haiku/Makefile @@ -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 diff --git a/src/nnn.c b/src/nnn.c index 9d8abf98..f7aae235 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -76,7 +76,7 @@ #include #include #include -#ifndef NOLOCALE +#ifndef NOLC #include #endif #include @@ -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