Changeset: 2c156d7e0a9d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c156d7e0a9d
Modified Files:
        gdk/ChangeLog.Aug2011
        gdk/gdk_bbp.mx
Branch: Aug2011
Log Message:

Convert / and \ inside BBP.dir to the local convention and remove \r.


diffs (52 lines):

diff --git a/gdk/ChangeLog.Aug2011 b/gdk/ChangeLog.Aug2011
--- a/gdk/ChangeLog.Aug2011
+++ b/gdk/ChangeLog.Aug2011
@@ -1,6 +1,11 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Wed Aug 10 2011 Sjoerd Mullender <[email protected]>
+- On Windows and Linux/Unix we can now read databases built on the other
+  O/S, as long as the hardware-related architecture (bit size, floating
+  point format, etc.) is identical.
+
 * Wed May 11 2011 Sjoerd Mullender <[email protected]>
 - Implemented automatic conversion of a 64-bit database with 32-bit OIDs
   to one with 64-bit OIDs.
diff --git a/gdk/gdk_bbp.mx b/gdk/gdk_bbp.mx
--- a/gdk/gdk_bbp.mx
+++ b/gdk/gdk_bbp.mx
@@ -892,6 +892,14 @@ BBPreadEntries(FILE *fp, char *src, int 
                unsigned short map_head, map_tail, map_hheap, map_theap;
                int Hhashash, Thashash;
 
+               if ((s = strchr(buf, '\r')) != NULL) {
+                       /* convert \r\n into just \n */
+                       if (s[1] != '\n')
+                               GDKfatal("BBPinit: invalid format for BBP.dir");
+                       *s++ = '\n';
+                       *s = 0;
+               }
+
                if (sscanf(buf,
                           "%lld %hu %128s %128s %128s %d %u %lld %lld %lld 
%lld %lld %hu %hu %hu %hu"
                           "%n",
@@ -902,6 +910,18 @@ BBPreadEntries(FILE *fp, char *src, int 
                           &nread) < 16)
                        GDKfatal("BBPinit: invalid format for BBP.dir%s", buf);
 
+               /* convert both / and \ path separators to our own DIR_SEP */
+#if DIR_SEP != '/'
+               s = filename;
+               while ((s = strchr(s, '/')) != NULL)
+                       *s++ = DIR_SEP;
+#endif
+#if DIR_SEP != '\\'
+               s = filename;
+               while ((s = strchr(s, '\\')) != NULL)
+                       *s++ = DIR_SEP;
+#endif
+
                if (src && strcmp(src, filename) != 0)
                        continue;
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to