X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Ftpath.c;h=231d29f5374aa04334e50a4984a3eb1279b9c22c;hp=b802c98033a0af6df45dfc91bfc58f9fdc85e644;hb=8ceaeefe2e491935cba91f56007308be6e4996e6;hpb=cf6bf2f04ed7e376bfd9a37f7ef4ab0366f46804 diff --git a/src/tpath.c b/src/tpath.c index b802c98..231d29f 100644 --- a/src/tpath.c +++ b/src/tpath.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) 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,7 @@ int yaz_is_abspath(const char *p) #ifdef WIN32 if (*p == '\\') return 1; - if (*p && p[1] == ':' && + if (*p && p[1] == ':' && ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z'))) return 1; #endif