From f42f51f0370f6fb457be7a8c0249387a2eb201fd Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 24 Jul 2018 10:29:16 +0200 Subject: [PATCH] ./ and ../ are still relative paths. Only files beginning with / and X:\ should be included directly. --- engine/vfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/vfs.c b/engine/vfs.c index b1aa3b5..ce1abfb 100644 --- a/engine/vfs.c +++ b/engine/vfs.c @@ -2875,12 +2875,11 @@ PH7_PRIVATE void *PH7_StreamOpenHandle(ph7_vm *pVm, const ph7_io_stream *pStream } SyStringInitFromBuf(&sFile, zFile, SyStrlen(zFile)); if(use_include) { - if(sFile.zString[0] == '/' || + if(sFile.zString[0] == '/' #ifdef __WINNT__ - (sFile.nByte > 2 && sFile.zString[1] == ':' && (sFile.zString[2] == '\\' || sFile.zString[2] == '/')) || + || (sFile.nByte > 2 && sFile.zString[1] == ':' && (sFile.zString[2] == '\\' || sFile.zString[2] == '/')) || #endif - (sFile.nByte > 1 && sFile.zString[0] == '.' && sFile.zString[1] == '/') || - (sFile.nByte > 2 && sFile.zString[0] == '.' && sFile.zString[1] == '.' && sFile.zString[2] == '/')) { + ) { /* Get real path to the included file */ SyRealPath(zFile, sFilePath); /* Open the file directly */