From 82abfd3e1b15405dfe64d573aaba70046dfe2138 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 9 Dec 2007 05:33:59 +0000 Subject: [PATCH] Insert a path separator in returned paths in init_scandir when WIN32 is defined in nse_init.cc. The Windows code was inserting a separator to find files (e.g. globbing on "%s\*") but was not inserting the separator in returned paths. A symptom of this was scanning with --script=scripts and seeing error messages about not being able to access things like "C:\Nmap\scriptsanonFTP.nse" (should be "C:\Nmap\scripts\anonFTP.nse"). --- nse_init.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nse_init.cc b/nse_init.cc index 1ffde016b..54029f7d8 100644 --- a/nse_init.cc +++ b/nse_init.cc @@ -632,7 +632,7 @@ int init_scandir(char* dirname, std::vector& result, int files_or_d // otherwise we add it to the results // we assume that dirname ends with a directory separator of some kind - path = std::string(dirname) + std::string(entry.cFileName); + path = std::string(dirname) + "\\" + std::string(entry.cFileName); result.push_back(path); morefiles = FindNextFile(dir, &entry); }