changeset 5384:8df6524b9500

[project @ 2005-06-09 21:06:28 by dbateman]
author dbateman
date Thu, 09 Jun 2005 21:06:28 +0000
parents ffea7e58bc00
children 5f48f2956e37
files src/ChangeLog src/ls-mat5.cc
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jun 09 19:53:49 2005 +0000
+++ b/src/ChangeLog	Thu Jun 09 21:06:28 2005 +0000
@@ -1,3 +1,8 @@
+2005-06-09  David Bateman <dbateman@free.fr>
+
+	* ls-mat5.cc (save_mat5_element_length): 1 element strings will be
+	saved in a compressed format, so calculate the length accordingly.
+
 2005-05-30  David Bateman <dbateman@free.fr>
 
 	* ls-mat5.cc (read_mat5_binary_element): Don't convert to string
--- a/src/ls-mat5.cc	Thu Jun 09 19:53:49 2005 +0000
+++ b/src/ls-mat5.cc	Thu Jun 09 21:06:28 2005 +0000
@@ -1338,7 +1338,9 @@
   if (tc.is_string ())
     {
       charMatrix chm = tc.char_matrix_value ();
-      ret += 8 + PAD (2 * chm.rows () * chm.cols ());
+      ret += 8;
+      if (chm.nelem () > 1)
+	ret += PAD (2 * chm.rows () * chm.cols ());
     }
   else if (cname == "sparse")
     {