- Conditionally include <locale.h>.
authorWayne Davison <wayned@samba.org>
Fri, 1 Apr 2005 17:25:37 +0000 (17:25 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 1 Apr 2005 17:25:37 +0000 (17:25 +0000)
- Conditionally call setlocale(LC_CTYPE, "").

main.c

diff --git a/main.c b/main.c
index b7e6c3a..0c5fc57 100644 (file)
--- a/main.c
+++ b/main.c
@@ -20,6 +20,9 @@
 */
 
 #include "rsync.h"
+#if defined CONFIG_LOCALE && defined HAVE_LOCALE_H
+#include <locale.h>
+#endif
 
 extern int verbose;
 extern int dry_run;
@@ -1115,6 +1118,10 @@ int main(int argc,char *argv[])
         * see the EPIPE. */
        signal(SIGPIPE, SIG_IGN);
 
+#if defined CONFIG_LOCALE && defined HAVE_SETLOCALE
+       setlocale(LC_CTYPE, "");
+#endif
+
        /* Initialize push_dir here because on some old systems getcwd
         * (implemented by forking "pwd" and reading its output) doesn't
         * work when there are other child processes.  Also, on all systems