[m-rev.] for review: mtags sorting
Peter Wang
wangp at students.cs.mu.OZ.AU
Mon Jan 30 11:04:48 AEDT 2006
Estimated hours taken: 0.5
Branches: main
scripts/mtags:
Set the `LC_COLLATE' environment variable to "C" when running
the `sort' program. This ensures vi-style tags files produced
by `mtags' are sorted in the correct order regardless of the
user's locale settings.
Index: scripts/mtags
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mtags,v
retrieving revision 1.35
diff -u -r1.35 mtags
--- scripts/mtags 4 Oct 2005 23:50:14 -0000 1.35
+++ scripts/mtags 29 Jan 2006 23:38:49 -0000
@@ -333,11 +333,11 @@
} elsif ($keep_dups) {
# Vim and elvis expect the tags file to be sorted so they can do
# binary search.
- open(OUT, "| sort > tags") ||
+ open(OUT, "| LC_COLLATE=C sort > tags") ||
die "mtags: error opening pipe: $!\n";
} else {
# Remove duplicate tags for vi.
- open(OUT, "| sort -u +0 -1 > tags") ||
+ open(OUT, "| LC_COLLATE=C sort -u +0 -1 > tags") ||
die "mtags: error opening pipe: $!\n";
}
$context = "implementation";
@@ -350,7 +350,7 @@
open(OUT, ">> TAGS") || die "mtags: error opening TAGS: $!\n";
printf OUT "\f\n%s,%d\n", $file, 0;
close(OUT) || die "mtags: error closing TAGS: $!\n";
- # open(OUT, "| sort -u +0 -1 >> TAGS") ||
+ # open(OUT, "| LC_COLLATE=C sort -u +0 -1 >> TAGS") ||
open(OUT, ">> TAGS") ||
die "mtags: error opening pipe: $!\n";
}
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list