changeset 2405:babe47314c61

* fixed history appending bug (Thanks Claude) * updated version for release * few more fixes for CMake build
author rotor <rotor>
date Mon, 03 Dec 2007 14:19:35 +0000
parents 7430c95a843f
children ea41b0a5d45f
files configure.in libsrc/minc_convenience.c volume_io/Include/volume_io/geom_structs.h
diffstat 3 files changed, 25 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in
+++ b/configure.in
@@ -1,12 +1,12 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(minc, [2.0.14], [a.janke@gmail.com])
+AC_INIT(minc, [2.0.15], [a.janke@gmail.com])
 AC_CONFIG_SRCDIR([libsrc2/minc2.h])
 AC_CONFIG_AUX_DIR(ac_config_aux)
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADERS([config.h])
 
-AC_REVISION($Revision: 6.31 $)
+AC_REVISION($Revision: 6.32 $)
 
 AC_PROG_INSTALL
 AC_PROG_LN_S
--- a/libsrc/minc_convenience.c
+++ b/libsrc/minc_convenience.c
@@ -30,7 +30,12 @@
 @CREATED    : July 27, 1992. (Peter Neelin, Montreal Neurological Institute)
 @MODIFIED   : 
  * $Log: minc_convenience.c,v $
- * Revision 6.18  2004-12-14 23:53:46  bert
+ * Revision 6.19  2007-12-03 14:19:35  rotor
+ *  * fixed history appending bug (Thanks Claude)
+ *  * updated version for release
+ *  * few more fixes for CMake build
+ *
+ * Revision 6.18  2004/12/14 23:53:46  bert
  * Get rid of compilation warnings
  *
  * Revision 6.17  2004/12/03 21:52:35  bert
@@ -137,7 +142,7 @@
 ---------------------------------------------------------------------------- */
 
 #ifndef lint
-static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc_convenience.c,v 6.18 2004-12-14 23:53:46 bert Exp $ MINC (MNI)";
+static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc_convenience.c,v 6.19 2007-12-03 14:19:35 rotor Exp $ MINC (MNI)";
 #endif
 
 #include "minc_private.h"
@@ -1369,6 +1374,7 @@
      * additional newline.
      */
     att_val = malloc(att_len + strlen(tm_stamp) + 2);
+
     if (att_val == NULL) {
         return (MI_ERROR);
     }
@@ -1378,13 +1384,20 @@
             return (MI_ERROR);
         }
 
+        /* Remove any trailing null characters. Make sure not to go before
+           the start of the string. */
         while (att_val[att_len-1] == '\0' ) {
             att_len--;
+            if( att_len == 0 ) break;
         }
 
-        if (att_val[att_len-1] != '\n') {
+        /* Add a carriage return to separate from the new history line
+           if there is a previous history line. */
+        if( att_len > 0 ) {
+          if (att_val[att_len-1] != '\n') {
             att_val[att_len] = '\n';
             att_len++;
+          }
         }
     }
 
--- a/volume_io/Include/volume_io/geom_structs.h
+++ b/volume_io/Include/volume_io/geom_structs.h
@@ -13,7 +13,7 @@
               make no representations about the suitability of this
               software for any purpose.  It is provided "as is" without
               express or implied warranty.
-@VERSION    : $Header: /private-cvsroot/minc/volume_io/Include/volume_io/geom_structs.h,v 1.23 2006-04-07 14:47:15 rotor Exp $
+@VERSION    : $Header: /private-cvsroot/minc/volume_io/Include/volume_io/geom_structs.h,v 1.24 2007-12-03 14:19:35 rotor Exp $
 ---------------------------------------------------------------------------- */
 
 /* ----------------------------- MNI Header -----------------------------------
@@ -79,9 +79,9 @@
 
 #define  fill_Point( point, x, y, z ) \
             { \
-                Point_x(point) = (Point_coord_type) (x); \
-                Point_y(point) = (Point_coord_type) (y); \
-                Point_z(point) = (Point_coord_type) (z); \
+                Point_x(point) = (VIO_Point_coord_type) (x); \
+                Point_y(point) = (VIO_Point_coord_type) (y); \
+                Point_z(point) = (VIO_Point_coord_type) (z); \
             }
 
 /* ----------------------------- MNI Header -----------------------------------
@@ -116,9 +116,9 @@
 
 #define  fill_Vector( vector, x, y, z ) \
             { \
-                Vector_x(vector) = (Point_coord_type) (x); \
-                Vector_y(vector) = (Point_coord_type) (y); \
-                Vector_z(vector) = (Point_coord_type) (z); \
+                Vector_x(vector) = (VIO_Point_coord_type) (x); \
+                Vector_y(vector) = (VIO_Point_coord_type) (y); \
+                Vector_z(vector) = (VIO_Point_coord_type) (z); \
             }
 
 /* ----------------------------- MNI Header -----------------------------------