Sort entries by locale collating order when -x is specified.

This commit is contained in:
Tim J. Robbins 2002-05-30 11:43:20 +00:00
parent 5b6c090658
commit df111dde6e
2 changed files with 7 additions and 1 deletions

View File

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

View File

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