Sort entries by locale collating order when -x is specified.
This commit is contained in:
parent
68f8c604ee
commit
076fcd4805
@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <err.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -97,6 +98,8 @@ main(argc, argv)
|
||||
int ch; /* getopts char */
|
||||
char *cmd;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
aflag = uflag = NO;
|
||||
tflag = YES;
|
||||
while ((ch = getopt(argc, argv, "BFTadf:tuwvx")) != -1)
|
||||
@ -142,6 +145,9 @@ main(argc, argv)
|
||||
if (!argc)
|
||||
usage();
|
||||
|
||||
if (!xflag)
|
||||
setlocale(LC_COLLATE, "C");
|
||||
|
||||
init();
|
||||
|
||||
for (exit_val = step = 0; step < argc; ++step)
|
||||
|
@ -104,7 +104,7 @@ add_node(node, cur_node)
|
||||
{
|
||||
int dif;
|
||||
|
||||
dif = strcmp(node->entry, cur_node->entry);
|
||||
dif = strcoll(node->entry, cur_node->entry);
|
||||
if (!dif) {
|
||||
if (node->file == cur_node->file) {
|
||||
if (!wflag)
|
||||
|
Loading…
Reference in New Issue
Block a user