Changeset 1828
- Timestamp:
- 2/12/2010 6:14:28 AM (3 years ago)
- Location:
- trunk/eraser6/ShellExt
- Files:
-
- 2 edited
-
CtxMenu.cpp (modified) (3 diffs)
-
CtxMenu.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/ShellExt/CtxMenu.cpp
r1820 r1828 524 524 DWORD attributes = GetFileAttributes(item.c_str()); 525 525 526 //Escape the string527 std::wstring escapedItem(EscapeString(item));528 529 526 //Add the correct command line for the file type. 530 527 if (attributes & FILE_ATTRIBUTE_DIRECTORY) 531 commandLine += L"\"dir=" + escapedItem + L"\" ";528 commandLine += L"\"dir=" + item + L"\" "; 532 529 else 533 commandLine += L"\"file=" + escapedItem + L"\" ";530 commandLine += L"\"file=" + item + L"\" "; 534 531 } 535 532 } … … 550 547 i != SelectedFiles.end(); ++i) 551 548 { 552 std::wstring escapedItem(EscapeString(*i)); 553 commandLine += L"\"unused=" + escapedItem + L",clusterTips\" "; 549 commandLine += L"\"unused=" + *i + L",clusterTips\" "; 554 550 } 555 551 … … 724 720 725 721 return std::wstring(stringTable + 1, *stringTable); 726 }727 728 std::wstring CCtxMenu::EscapeString(const std::wstring& string)729 {730 //Escape the command line (= and , are special characters)731 std::wstring escapedItem;732 escapedItem.reserve(string.length());733 for (std::wstring::const_iterator i = string.begin(); i != string.end(); ++i)734 {735 if (wcschr(L"\\=,", *i))736 escapedItem += '\\';737 escapedItem += *i;738 }739 740 return escapedItem;741 722 } 742 723 -
trunk/eraser6/ShellExt/CtxMenu.h
r1675 r1828 81 81 82 82 static std::wstring LoadString(UINT stringID); 83 static std::wstring EscapeString(const std::wstring& string);84 83 static std::wstring FormatString(const std::wstring& formatString, ...); 85 84 static std::wstring FormatError(DWORD lastError = static_cast<DWORD>(-1));
Note: See TracChangeset
for help on using the changeset viewer.
