fix cygwin-only path traversal

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1275 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.12
Jan Kneschke 2006-09-01 10:07:09 +00:00
parent 48ca389d89
commit 71e66c88ec
1 changed files with 12 additions and 0 deletions

View File

@ -914,6 +914,18 @@ int buffer_path_simplify(buffer *dest, buffer *src)
start = dest->ptr;
out = dest->ptr;
slash = dest->ptr;
#if defined(__WIN32) || defined(__CYGWIN__)
/* cygwin is treating \ and / the same, so we have to that too
*/
for (walk = src->ptr; *walk; walk++) {
if (*walk == '\\') *walk = '/';
}
walk = src->ptr;
#endif
while (*walk == ' ') {
walk++;
}