Target nolocale: saves more on memory

This commit is contained in:
Arun Prakash Jana 2019-10-04 07:43:07 +05:30
parent 241a261531
commit 133f55170b
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 11 additions and 0 deletions

View file

@ -42,6 +42,9 @@ debug: $(SRC)
norl: $(SRC) norl: $(SRC)
$(CC) -DNORL $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS) $(CC) -DNORL $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
nolocale: $(SRC)
$(CC) -DNORL -DNOLOCALE $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
install: all install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin

View file

@ -74,7 +74,9 @@
#ifdef __gnu_hurd__ #ifdef __gnu_hurd__
#define PATH_MAX 4096 #define PATH_MAX 4096
#endif #endif
#ifndef NOLOCALE
#include <locale.h> #include <locale.h>
#endif
#include <stdio.h> #include <stdio.h>
#ifndef NORL #ifndef NORL
#include <readline/history.h> #include <readline/history.h>
@ -1349,7 +1351,11 @@ static int xstricmp(const char * const s1, const char * const s2)
} }
/* Handle 1. all non-numeric and 2. both same numeric value cases */ /* Handle 1. all non-numeric and 2. both same numeric value cases */
#ifndef NOLOCALE
return strcoll(s1, s2); return strcoll(s1, s2);
#else
return strcasecmp(s1, s2);
#endif
} }
/* /*
@ -4960,8 +4966,10 @@ int main(int argc, char *argv[])
return _FAILURE; return _FAILURE;
} }
#ifndef NOLOCALE
/* Set locale */ /* Set locale */
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#endif
#ifndef NORL #ifndef NORL
#if RL_READLINE_VERSION >= 0x0603 #if RL_READLINE_VERSION >= 0x0603