Skip to content

Commit

Permalink
Fixed Name Matching Bug In /SharePaths
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMoreFood committed Aug 23, 2016
1 parent 892ade9 commit ce42a02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions OperationSharePaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ OperationSharePaths::OperationSharePaths(std::queue<std::wstring> & oArgList) :
bool bAdminOnly = false;
bool bHiddenIncluded = false;
std::wregex oMatchRegex = std::wregex(L".*");
std::wregex oNoMatchRegex = std::wregex(L"\0");
std::wregex oNoMatchRegex = std::wregex(L":");
if (sSubArgs.size() == 2)
{
// further split the second arg into a command delimited list
Expand Down Expand Up @@ -51,7 +51,7 @@ OperationSharePaths::OperationSharePaths(std::queue<std::wstring> & oArgList) :
try
{
// parse the regular expression
(_wcsnicmp((*sShareArg).c_str(), sMatchArg, _countof(sMatchArg) - 1) == 0) ? oMatchRegex : oNoMatchRegex =
((_wcsnicmp((*sShareArg).c_str(), sMatchArg, _countof(sMatchArg) - 1) == 0) ? oMatchRegex : oNoMatchRegex) =
std::wregex(oMatchArgs[1], std::regex_constants::icase);
}
catch (std::exception &)
Expand Down Expand Up @@ -123,10 +123,10 @@ OperationSharePaths::OperationSharePaths(std::queue<std::wstring> & oArgList) :
std::transform(sLocalPath.begin(), sLocalPath.end(), sLocalPath.begin(), ::toupper);

// see if the share name matches the regular expression
if (!std::regex_match(tInfo[iEntry].shi2_netname, oMatchRegex)) continue;
if (!std::regex_search(tInfo[iEntry].shi2_netname, oMatchRegex)) continue;

// see if the share name does not match the regular expression
if (std::regex_match(tInfo[iEntry].shi2_netname, oNoMatchRegex)) continue;
if (std::regex_search(tInfo[iEntry].shi2_netname, oNoMatchRegex)) continue;

// add path to the share list
mPaths[tInfo[iEntry].shi2_netname] = sLocalPath;
Expand Down
2 changes: 1 addition & 1 deletion Version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once

#define VERSION_STRING "1.6.2.0"
#define VERSION_STRING "1.6.2.1"

0 comments on commit ce42a02

Please sign in to comment.