[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/keximdb/koffice-1.6/keximdb/src
From:       Jarosław Staniek <staniek () kde ! org>
Date:       2009-09-13 22:50:38
Message-ID: 1252882238.364138.6377.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1023122 by staniek:

Migration
* backport recent crashfixes by piggz
* fix typo in date/time formatting string, this fixes importing Northwind.mdb on \
windows (assertion in strftime())



 M  +1 -1      keximdb/mdbmigrate.cpp  
 M  +2 -2      mdbtools/libmdb/index.c  
 M  +7 -6      mdbtools/libmdb/table.c  


--- branches/work/keximdb/koffice-1.6/keximdb/src/keximdb/mdbmigrate.cpp \
#1023121:1023122 @@ -70,7 +70,7 @@
   // (where T is a literal).  The following is equivalent to %FT%T, but
   // backards compatible with old/Windows C libraries.
   // See strftime documentation for more info.
-  mdb_set_date_fmt("%Y-%m-%dT%H:%M%:%S");
+  mdb_set_date_fmt("%Y-%m-%dT%H:%M:%S");
 }
 
 void MDBMigrate::releaseBackend() {
--- branches/work/keximdb/koffice-1.6/keximdb/src/mdbtools/libmdb/index.c \
#1023121:1023122 @@ -120,13 +120,13 @@
 		if (IS_JET4(mdb)) cur_pos += 4;
 		do {
 			pidx = g_ptr_array_index (table->indices, idx_num++);
-		} while (pidx && pidx!=(MdbIndex*)0xbaadf00d /*(js) temp? hack*/&& \
pidx->index_type==2); +		} while (idx_num < table->num_real_idxs && pidx /*&& pidx != \
0x736e6f6300616d65 && pidx!=(MdbIndex*)0xbaadf00d*/ /*(js) temp? hack*/&& \
pidx->index_type==2);  
 		/* if there are more real indexes than index entries left after
 		   removing type 2's decrement real indexes and continue.  Happens
 		   on Northwind Orders table.
 		*/
-		if (!pidx || pidx==(MdbIndex*)0xbaadf00d /*(js) temp? hack*/) {
+		if (idx_num == table->num_real_idxs || !pidx /*|| pidx==(MdbIndex*)0xbaadf00d*/ \
/*(js) temp? hack*/ /*|| pidx != 0x736e6f6300616d65*/) {  table->num_real_idxs--;
 			continue;
 		}
--- branches/work/keximdb/koffice-1.6/keximdb/src/mdbtools/libmdb/table.c \
#1023121:1023122 @@ -161,6 +161,7 @@
 void * 
 read_pg_if_n(MdbHandle *mdb, void *buf, int *cur_pos, size_t len)
 {
+	char *buf_char = (char *)buf;
 	/* Advance to page which contains the first byte */
 	while (*cur_pos >= mdb->fmt->pg_size) {
 		mdb_read_pg(mdb, mdb_get_int32(mdb->pg_buf,4));
@@ -169,20 +170,20 @@
 	/* Copy pages into buffer */
 	while (*cur_pos + len >= mdb->fmt->pg_size) {
 		int piece_len = mdb->fmt->pg_size - *cur_pos;
-		if (buf) {
-			memcpy(buf, mdb->pg_buf + *cur_pos, piece_len);
-			buf += piece_len;
+		if (buf_char) {
+			memcpy(buf_char, mdb->pg_buf + *cur_pos, piece_len);
+			buf_char += piece_len;
 		}
 		len -= piece_len;
 		mdb_read_pg(mdb, mdb_get_int32(mdb->pg_buf,4));
 		*cur_pos = 8;
 	}
 	/* Copy into buffer from final page */
-	if (len && buf) {
-		memcpy(buf, mdb->pg_buf + *cur_pos, len);
+	if (len && buf_char) {
+		memcpy(buf_char, mdb->pg_buf + *cur_pos, len);
 	}
 	*cur_pos += len;
-	return buf;
+	return buf_char;
 }
 
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic