From c5af89209c854d3f97d2d1577f585a3b1341e4c0 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 6 Aug 2004 21:29:03 +0000 Subject: [PATCH] fixed handling of relative paths such as \file.ext in do_add_file git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3598 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index f72294c8..dc3df4bc 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -5492,14 +5492,15 @@ int CEXEBuild::do_add_file(const char *lgss, int attrib, int recurse, int linecn { char *s=dir+strlen(dir); while (s > dir && *s != PATH_SEPARATOR_C) s=CharPrev(dir,s); - *s=0; -#ifndef _WIN32 - if (!*dir) + if (s == dir) { - dir[0] = '.'; - dir[1] = 0; + if (*s == PATH_SEPARATOR_C) + sprintf(dir,"%c.",PATH_SEPARATOR_C); + else + strcpy(dir,"."); } -#endif + else + s[0]=0; } #ifdef _WIN32