Changeset 4580c6c in nscp for modules/CheckExternalScripts/CheckExternalScripts.cpp
- Timestamp:
- 07/08/09 21:23:39 (4 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 79f8b2c
- Parents:
- dcd5462
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/CheckExternalScripts/CheckExternalScripts.cpp
rb1ac2fa r4580c6c 25 25 #include <config.h> 26 26 #include <msvc_wrappers.h> 27 #include <file_helpers.hpp> 27 28 28 29 CheckExternalScripts gCheckExternalScripts; … … 38 39 39 40 void CheckExternalScripts::addAllScriptsFrom(std::wstring path) { 40 std::wstring baseDir; 41 file_helpers::patterns::pattern_type pattern = file_helpers::patterns::split_pattern(path); 42 if (!file_helpers::checks::exists(pattern.first)) 43 pattern.first = NSCModuleHelper::getBasePath() + _T("\\") + pattern.first; 44 if (!file_helpers::checks::exists(pattern.first)) 45 NSC_LOG_ERROR_STD(_T("Path was not found: ") + pattern.first); 46 /* TODO: do we need this? 41 47 std::wstring::size_type pos = path.find_last_of('*'); 42 48 if (pos == std::wstring::npos) { 43 49 path += _T("*.*"); 44 50 } 51 */ 45 52 WIN32_FIND_DATA wfd; 46 HANDLE hFind = FindFirstFile(path.c_str(), &wfd); 53 std::wstring real_path = file_helpers::patterns::combine_pattern(pattern); 54 HANDLE hFind = FindFirstFile(real_path.c_str(), &wfd); 47 55 if (hFind != INVALID_HANDLE_VALUE) { 48 56 do { 49 57 if ((wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { 50 addCommand(wfd.cFileName );58 addCommand(wfd.cFileName, pattern.first + _T("\\") + wfd.cFileName, _T("")); 51 59 } 52 60 } while (FindNextFile(hFind, &wfd)); 53 61 } else { 54 NSC_LOG_ERROR_STD(_T("No scripts found in path: ") + path);62 NSC_LOG_ERROR_STD(_T("No scripts found in path: ") + real_path); 55 63 return; 56 64 }
Note: See TracChangeset
for help on using the changeset viewer.








