Changeset: ea5b874f5289 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea5b874f5289
Modified Files:
        gdk/gdk_posix.c
Branch: Feb2013
Log Message:

On Windows, an absolute path is: drive letter, colon, directory separator.


diffs (22 lines):

diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -849,13 +849,11 @@ MT_mallinfo(void)
 int
 MT_path_absolute(const char *pathname)
 {
-       char *drive_end = strchr(pathname, ':');
-       char *path_start = strchr(pathname, '\\');
-
-       if (path_start == NULL) {
-               return 0;
-       }
-       return (path_start == pathname || drive_end == (path_start - 1));
+       /* drive letter, colon, directory separator */
+       return ((('a' <= pathname[0] && pathname[0] <= 'z') ||
+                ('A' <= pathname[0] && pathname[0] <= 'Z')) &&
+               pathname[1] == ':' &&
+               (pathname[2] == '/' || pathname[2] == '\\'));
 }
 
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to