Update header about CQL grammar
[yaz-moved-to-github.git] / src / tpath.c
index 900552e..1510465 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2013 Index Data
  * See the file LICENSE for details.
  */
 /**
@@ -56,7 +56,7 @@ size_t yaz_filepath_comp(const char **path_p, const char **comp)
         path_sep = strchr(path+2, ':');
     else
         path_sep = 0;
-    
+
     if (path_sep)
     {
         len = path_sep - path;
@@ -76,11 +76,13 @@ char *yaz_filepath_resolve(const char *fname, const char *path,
 {
     if (path && *path == '\0')
         path = 0;
+    if (strchr("/\\", *fname))
+        path = 0;
     for (;;)
     {
         struct stat stat_buf;
         size_t slen = 0;
-       
+
         *fullpath = '\0';
         if (path)
         {
@@ -129,7 +131,8 @@ int yaz_is_abspath(const char *p)
 #ifdef WIN32
     if (*p == '\\')
         return 1;
-    if (*p && p[1] == ':' && isalpha(*p))
+    if (*p && p[1] == ':' &&
+        ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')))
         return 1;
 #endif
     return 0;