yaz_filepath_resolve: path search for abs fname
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 8 Sep 2011 06:43:31 +0000 (08:43 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 8 Sep 2011 06:43:31 +0000 (08:43 +0200)
If fname is absolute, the path is not searched.

src/tpath.c

index b802c98..d020e76 100644 (file)
@@ -76,6 +76,8 @@ 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;