diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-28 23:25:11 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-28 23:25:11 +0000 |
commit | 76b8ec2c0d77737e11762ec8ad59e477b509d0a9 (patch) | |
tree | 7f2451c086517ce427b8e259cd653c78a293d11a /Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp | |
parent | 954d7e9021f276f3bc0a0b8d9d0c7f7d77647642 (diff) |
dvisvgm-1.14
git-svn-id: svn://tug.org/texlive/trunk@39217 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp')
-rw-r--r-- | Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp index 2418c8fb786..0c3ea270add 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp @@ -115,7 +115,9 @@ std::string FileFinder::version () { } #else if (const char *v = strrchr(KPSEVERSION, ' ')) - return v+1; + return (std::string(KPSEVERSION).substr(0, 9) == "kpathsea ") ? v+1 : KPSEVERSION; + if (strlen(KPSEVERSION) > 0) + return KPSEVERSION; #endif return "unknown"; } @@ -130,6 +132,12 @@ static const char* find_file (const std::string &fname, const char *ftype) { if (!_initialized || fname.empty()) return 0; + static std::string buf; + // try to lookup the file in the current working directory + buf = FileSystem::getcwd()+"/"+fname; + if (FileSystem::exists(buf.c_str())) + return buf.c_str(); + std::string ext; if (ftype) ext = ftype; @@ -140,7 +148,6 @@ static const char* find_file (const std::string &fname, const char *ftype) { ext = fname.substr(pos+1); } - static std::string buf; #ifdef MIKTEX if (ext == "dll" || ext == "exe") { // lookup dll and exe files in the MiKTeX bin directory first |