Changeset 1828 for trunk/eraser6/ShellExt/CtxMenu.cpp
- Timestamp:
- 2/12/2010 6:14:28 AM (2 years ago)
- File:
-
- 1 edited
-
trunk/eraser6/ShellExt/CtxMenu.cpp (modified) (3 diffs)
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
Note: See TracChangeset
for help on using the changeset viewer.
