norl: $(SRC)
$(CC) -DNORL $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
+nolocale: $(SRC)
+ $(CC) -DNORL -DNOLOCALE $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
+
install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin
#ifdef __gnu_hurd__
#define PATH_MAX 4096
#endif
+#ifndef NOLOCALE
#include <locale.h>
+#endif
#include <stdio.h>
#ifndef NORL
#include <readline/history.h>
}
/* Handle 1. all non-numeric and 2. both same numeric value cases */
+#ifndef NOLOCALE
return strcoll(s1, s2);
+#else
+ return strcasecmp(s1, s2);
+#endif
}
/*
return _FAILURE;
}
+#ifndef NOLOCALE
/* Set locale */
setlocale(LC_ALL, "");
+#endif
#ifndef NORL
#if RL_READLINE_VERSION >= 0x0603