[Pkg-amule-commits] [amule] 03/07: upstream patch to prevent a crash if a shared dir contains UTF-8 chars; Closes: #850768

Sandro Tosi morph at moszumanska.debian.org
Sat Dec 9 21:03:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository amule.

commit a72bd10a9885ee9683b179b87abccf7f4fa706f8
Author: Sandro Tosi <morph at debian.org>
Date:   Sat Dec 9 13:49:01 2017 -0500

    upstream patch to prevent a crash if a shared dir contains UTF-8 chars; Closes: #850768
---
 .../17816ed02f59bab9c27310e7f24c73266b0a3003.patch | 75 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 76 insertions(+)

diff --git a/debian/patches/17816ed02f59bab9c27310e7f24c73266b0a3003.patch b/debian/patches/17816ed02f59bab9c27310e7f24c73266b0a3003.patch
new file mode 100644
index 0000000..3c30a8b
--- /dev/null
+++ b/debian/patches/17816ed02f59bab9c27310e7f24c73266b0a3003.patch
@@ -0,0 +1,75 @@
+From 17816ed02f59bab9c27310e7f24c73266b0a3003 Mon Sep 17 00:00:00 2001
+From: persmule <persmule at gmail.com>
+Date: Wed, 5 Oct 2016 13:47:46 +0800
+Subject: [PATCH] Add a routine to set file name conversion for amuled which
+ based on wxAppConsole
+
+---
+ src/amule.h    |  7 +++++++
+ src/amuled.cpp | 35 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 42 insertions(+)
+
+diff --git a/src/amule.h b/src/amule.h
+index f25702f60..240c02dd9 100644
+--- a/src/amule.h
++++ b/src/amule.h
+@@ -553,6 +553,13 @@ class CamuleDaemonApp : public CamuleApp
+ 	int OnExit();
+ 
+ 	virtual int InitGui(bool geometry_enable, wxString &geometry_string);
++	// The GTK wxApps sets its file name conversion properly
++	// in wxApp::Initialize(), while wxAppConsole::Initialize()
++	// does not, leaving wxConvFile being set to wxConvLibc. File
++	// name conversion should be set otherwise amuled will abort to
++	// handle non-ASCII file names which monolithic amule can handle.
++	// This function are overrided to perform this.
++	virtual bool Initialize(int& argc_, wxChar **argv_);
+ 
+ #ifdef AMULED_APPTRAITS
+ 	struct sigaction m_oldSignalChildAction;
+diff --git a/src/amuled.cpp b/src/amuled.cpp
+index 486da5973..86e1ff8b8 100644
+--- a/src/amuled.cpp
++++ b/src/amuled.cpp
+@@ -704,6 +704,41 @@ int CamuleDaemonApp::InitGui(bool ,wxString &)
+ 	return 0;
+ }
+ 
++bool CamuleDaemonApp::Initialize(int& argc_, wxChar **argv_)
++{
++	if ( !wxAppConsole::Initialize(argc_, argv_) ) {
++		return false;
++	}
++
++#ifdef __UNIX__
++	wxString encName;
++#if wxUSE_INTL
++	// if a non default locale is set,
++	// assume that the user wants his
++        // filenames in this locale too
++        encName = wxLocale::GetSystemEncodingName().Upper();
++
++        // But don't consider ASCII in this case.
++	if ( !encName.empty() ) {
++		if ( encName == wxT("US-ASCII") ) {
++			// This means US-ASCII when returned
++			// from GetEncodingFromName().
++			encName.clear();
++		}
++        }
++#endif // wxUSE_INTL
++
++	// in this case, UTF-8 is used by default.
++        if ( encName.empty() ) {
++		encName = wxT("UTF-8");
++	}
++
++	static wxConvBrokenFileNames fileconv(encName);
++	wxConvFileName = &fileconv;
++#endif // __UNIX__
++
++	return true;
++}
+ 
+ int CamuleDaemonApp::OnExit()
+ {
diff --git a/debian/patches/series b/debian/patches/series
index d516e92..1b5df10 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ configure_ignore_gdlib-config_garbage.diff
 cas_configfile.c_good_default_paths.diff
 use_xdg-open_as_preview_default.diff
 version_check.diff
+17816ed02f59bab9c27310e7f24c73266b0a3003.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-amule/amule.git



More information about the Pkg-amule-commits mailing list