From 7ed54a99401f7a16edcba27725e92fb7474be240 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Sat, 3 Sep 2011 22:23:21 -0400
Subject: rankmirrors: properly sort resulting times

- Properly read each sorted line into a new array, instead of breaking
  on every word.
- LC_COLLATE should apply to the sort portion of the pipeline, not the
  printing.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
 scripts/rankmirrors.sh.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/rankmirrors.sh.in b/scripts/rankmirrors.sh.in
index a0ff6d5d..875a1439 100644
--- a/scripts/rankmirrors.sh.in
+++ b/scripts/rankmirrors.sh.in
@@ -92,7 +92,8 @@ getfetchurl() {
 
 # This exists to remove the need for a separate interrupt function
 finaloutput() {
-	IFS=$'\n' sortedarray=( $(LC_COLLATE=C printf "%s\n" "${timesarray[@]}" | sort) )
+	IFS=$'\n' read -r -d '' -a sortedarray < \
+		<(printf '%s\n' "${timesarray[@]}" | LC_COLLATE=C sort)
 
 	# Final output for mirrorfile
 	numiterator="0"
-- 
cgit v1.2.3-70-g09d2