[NEW_FEATURE] (Author: Ivan Radić, aka Loreia) Add the capacity to treat path like "\test\test.txt".
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@987 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
f22c49c7f4
commit
d1088bc2e2
|
@ -35,6 +35,18 @@
|
||||||
|
|
||||||
typedef std::vector<const TCHAR*> ParamVector;
|
typedef std::vector<const TCHAR*> ParamVector;
|
||||||
|
|
||||||
|
char getDriveLetter(){
|
||||||
|
char drive = '\0';
|
||||||
|
TCHAR current[MAX_PATH];
|
||||||
|
|
||||||
|
::GetCurrentDirectory(MAX_PATH, current);
|
||||||
|
int driveNbr = ::PathGetDriveNumber(current);
|
||||||
|
if (driveNbr != -1)
|
||||||
|
drive = 'A' + char(driveNbr);
|
||||||
|
|
||||||
|
return drive;
|
||||||
|
}
|
||||||
|
|
||||||
bool checkSingleFile(const TCHAR * commandLine) {
|
bool checkSingleFile(const TCHAR * commandLine) {
|
||||||
TCHAR fullpath[MAX_PATH];
|
TCHAR fullpath[MAX_PATH];
|
||||||
::GetFullPathName(commandLine, MAX_PATH, fullpath, NULL);
|
::GetFullPathName(commandLine, MAX_PATH, fullpath, NULL);
|
||||||
|
@ -256,6 +268,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ((currentFile[0] == '\\' && currentFile[1] != '\\') || currentFile[0] == '/')
|
||||||
|
{
|
||||||
|
quotFileName += getDriveLetter();
|
||||||
|
quotFileName += ':';
|
||||||
|
}
|
||||||
quotFileName += currentFile;
|
quotFileName += currentFile;
|
||||||
}
|
}
|
||||||
quotFileName += TEXT("\" ");
|
quotFileName += TEXT("\" ");
|
||||||
|
|
Loading…
Reference in New Issue