From 2d34c4b9bfec8e7cafbb1a7494a5b6d79e0a5b4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bert=20M=C3=BCnnich?= <ber.t@posteo.de>
Date: Tue, 24 Oct 2017 21:43:36 +0200
Subject: [PATCH] Set LC_COLLATE for -r file list sorting

Fixes issue #293.
---
 Makefile | 2 +-
 main.c   | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 7a4dbdc..4e3390a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = git-20171023
+VERSION = git-20171024
 
 srcdir = .
 VPATH = $(srcdir)
diff --git a/main.c b/main.c
index 9f0b84f..8eea930 100644
--- a/main.c
+++ b/main.c
@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
+#include <locale.h>
 #include <signal.h>
 #include <sys/select.h>
 #include <sys/stat.h>
@@ -813,6 +814,8 @@ int main(int argc, char **argv)
 
 	signal(SIGPIPE, SIG_IGN);
 
+	setlocale(LC_COLLATE, "");
+
 	parse_options(argc, argv);
 
 	if (options->clean_cache) {