[Box Backup-commit] COMMIT r1897 - box/chris/general/bin/bbackupquery

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Wed Oct 17 13:57:38 BST 2007


Author: chris
Date: 2007-10-17 13:57:38 +0100 (Wed, 17 Oct 2007)
New Revision: 1897

Modified:
   box/chris/general/bin/bbackupquery/bbackupquery.cpp
Log:
Set the locale from the environment, so that international characters
may be entered when using editline. (merges [1860])


Modified: box/chris/general/bin/bbackupquery/bbackupquery.cpp
===================================================================
--- box/chris/general/bin/bbackupquery/bbackupquery.cpp	2007-10-17 12:57:11 UTC (rev 1896)
+++ box/chris/general/bin/bbackupquery/bbackupquery.cpp	2007-10-17 12:57:38 UTC (rev 1897)
@@ -303,7 +303,16 @@
 	}
 	
 	// Get commands from input
+
 #ifdef HAVE_LIBREADLINE
+	// Must initialise the locale before using editline's readline(),
+	// otherwise cannot enter international characters.
+	if (setlocale(LC_ALL, "") == NULL)
+	{
+		BOX_ERROR("Failed to initialise locale. International "
+			"character support may not work.");
+	}
+
 #ifdef HAVE_READLINE_HISTORY
 	using_history();
 #endif




More information about the Boxbackup-commit mailing list