diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-06-20 02:36:18 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-06-20 02:36:18 +0000 |
commit | ed16b725b2948c6051be586987131e168d3d950f (patch) | |
tree | 15b5b218b9fa242b33043c81c25d43d161d5d984 /Build/source | |
parent | da0002d22435d2db4bf5fb48d52bd84dceff64ee (diff) |
Fix a potential bug (w32 only)
git-svn-id: svn://tug.org/texlive/trunk@34327 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/win32lib.c | 26 |
2 files changed, 22 insertions, 8 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index e3bf55810cc..f9df934866a 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2014-06-20 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * win32lib.c: Fix a potential bug (w32 only). + 2014-06-18 Peter Breitenlohner <peb@mppmu.mpg.de> * c-ctype.h: Avoid useless char subscript warnings. diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c index 9de8f6fa230..32d3381a492 100644 --- a/Build/source/texk/kpathsea/win32lib.c +++ b/Build/source/texk/kpathsea/win32lib.c @@ -245,15 +245,25 @@ drive name } if(*p == '\\') { *p = '\0'; - if((hnd = FindFirstFile(q, &ffd)) == INVALID_HANDLE_VALUE) { - return 0; + if((*(p-2) == '\\' || p-1 == q) && *(p-1) == '.') { + cnt += 2; + if(cnt > len) return 0; + strcat(buff, "./"); + } else if((*(p-3) == '\\' || p-2 == q) && *(p-2) == '.' && *(p-1) == '.') { + cnt += 3; + if(cnt > len) return 0; + strcat(buff, "../"); + } else { + if((hnd = FindFirstFile(q, &ffd)) == INVALID_HANDLE_VALUE) { + return 0; + } + FindClose(hnd); + cnt += strlen(ffd.cFileName); + cnt++; + if(cnt > len) return 0; + strcat(buff, ffd.cFileName); + strcat(buff, "/"); } - FindClose(hnd); - cnt += strlen(ffd.cFileName); - cnt++; - if(cnt > len) return 0; - strcat(buff, ffd.cFileName); - strcat(buff, "/"); *p = '\\'; } } |