Package: bless
Version: 0.6.0-5
Severity: important
Tags: patch

Hi

Many problems (one was already reported in bug: #767216) arised because the
preferences
file, last session file, and history file are not saved correctly.

Cause:
The XML class used (XmlTextWriter) causes troubles (i,e, it can only write 1024
bytes
without being flushed, causing the preferences.xml to be cut off at 1024 bytes
so there
are errors when loading it.

Solution:
Change to the newer XmlWriterSettings.

Attachment:
Attached is a patch file which solves the saving of all these XML files using
the
newer XmlWriterSettings class.
Now all the files are saved and loaded correctly, so all functions like
temporary
directory, last open file, cursor position, remember window geometry and file
history
work again normally as they should.

Note that bug #767216 (which is caused only by an empty "Temporary Directory")
can be closed too as the Temporary directory will now be populated correctly.

Regards



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bless depends on:
ii  libc6                         2.24-8
ii  libglade2.0-cil               2.12.40-1
ii  libglib2.0-cil                2.12.40-1
ii  libgtk2.0-cil                 2.12.40-1
ii  libmono-corlib4.5-cil         4.6.2.7+dfsg-1
ii  libmono-posix4.0-cil          4.6.2.7+dfsg-1
ii  libmono-system-xml4.0-cil     4.6.2.7+dfsg-1
ii  libmono-system4.0-cil         4.6.2.7+dfsg-1
ii  mono-runtime                  4.6.2.7+dfsg-1
ii  rarian-compat [scrollkeeper]  0.8.1-6

bless recommends no packages.

bless suggests no packages.

-- no debconf information
diff -Naurd bless-0.6.0.orig/src/tools/Preferences.cs bless-0.6.0/src/tools/Preferences.cs
--- bless-0.6.0.orig/src/tools/Preferences.cs	2008-06-07 14:18:14.000000000 +0200
+++ bless-0.6.0/src/tools/Preferences.cs	2016-10-28 22:47:50.000000000 +0200
@@ -127,10 +127,10 @@
 	///</summary>
 	public void Save(string path)
 	{
-		XmlTextWriter xml = new XmlTextWriter(path, null);
-		xml.Formatting = Formatting.Indented;
-		xml.Indentation = 1;
-		xml.IndentChar = '\t';
+		XmlWriterSettings settings = new XmlWriterSettings();
+		settings.Indent = true;
+		settings.IndentChars = ("\t");
+		XmlWriter xml = XmlWriter.Create(path, settings);
 
 		xml.WriteStartElement(null, "preferences", null);
 
diff -Naurd bless-0.6.0.orig/src/tools/Session.cs bless-0.6.0/src/tools/Session.cs
--- bless-0.6.0.orig/src/tools/Session.cs	2008-06-07 14:18:14.000000000 +0200
+++ bless-0.6.0/src/tools/Session.cs	2017-01-08 15:21:29.000000000 +0100
@@ -72,10 +72,10 @@
 
 	public void Save(string path)
 	{
-		XmlTextWriter xml = new XmlTextWriter(path, null);
-		xml.Formatting = Formatting.Indented;
-		xml.Indentation = 1;
-		xml.IndentChar = '\t';
+		XmlWriterSettings settings = new XmlWriterSettings();
+		settings.Indent = true;
+		settings.IndentChars = ("\t");
+		XmlWriter xml = XmlWriter.Create(path, settings);
 
 		xml.WriteStartElement(null, "session", null);
 

Reply via email to