1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-20 13:19:01 +00:00

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").

This commit is contained in:
david
2007-12-09 05:33:59 +00:00
parent b0d224e0da
commit 82abfd3e1b

View File

@@ -632,7 +632,7 @@ int init_scandir(char* dirname, std::vector<std::string>& 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);
}