Make option O_NOLOC renamed to O_NOLC

This commit is contained in:
Arun Prakash Jana 2021-05-24 22:38:08 +05:30
parent fdeba8a87e
commit db8079f552
No known key found for this signature in database
GPG Key ID: A75979F35C080412
3 changed files with 19 additions and 18 deletions

View File

@ -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)

View 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

View File

@ -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