summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-17 15:42:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-17 15:42:14 +0000
commitd6964f7bb1c2afc8d67905fa38ac9a3df766b807 (patch)
treec1faf62ec8a37d184fce91df7fc07243ec738f5d /src
parent69f3e7d05fcdab94dc78e52af620d46191fafb37 (diff)
obsolete services extincted
git-svn-id: http://svn.miranda-ng.org/main/trunk@14237 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/path.cpp49
-rw-r--r--src/mir_core/src/path.cpp12
2 files changed, 14 insertions, 47 deletions
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp
index e0b795574c..1df4dab0ea 100644
--- a/src/mir_app/src/path.cpp
+++ b/src/mir_app/src/path.cpp
@@ -30,45 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern TCHAR g_profileDir[MAX_PATH], g_shortProfileName[MAX_PATH];
static HANDLE hAvatarFolder;
-static TCHAR tszAvatarRoot[MAX_PATH];
+static TCHAR tszAvatarRoot[MAX_PATH];
-static INT_PTR pathToRelative(WPARAM wParam, LPARAM lParam)
-{
- return PathToRelative((char*)wParam, (char*)lParam);
-}
-
-static INT_PTR pathToAbsolute(WPARAM wParam, LPARAM lParam)
-{
- return PathToAbsolute((char*)wParam, (char*)lParam);
-}
-
-static INT_PTR createDirTree(WPARAM, LPARAM lParam)
-{
- if (lParam == 0)
- return 1;
-
- return CreateDirectoryTree((char*)lParam);
-}
-
-static INT_PTR pathToRelativeW(WPARAM wParam, LPARAM lParam)
-{
- return PathToRelativeW((WCHAR*)wParam, (WCHAR*)lParam );
-}
-
-static INT_PTR pathToAbsoluteW(WPARAM wParam, LPARAM lParam)
-{
- return PathToAbsoluteW((WCHAR*)wParam, (WCHAR*)lParam, NULL);
-}
-
-static INT_PTR createDirTreeW(WPARAM, LPARAM lParam)
-{
- if (lParam == 0)
- return 1;
-
- return CreateDirectoryTreeW((WCHAR*)lParam);
-}
-
-TCHAR *GetContactID(MCONTACT hContact)
+TCHAR* GetContactID(MCONTACT hContact)
{
TCHAR *theValue = {0};
char *szProto = GetContactProto(hContact);
@@ -421,15 +385,6 @@ static INT_PTR replaceVars(WPARAM wParam, LPARAM lParam)
int InitPathUtils(void)
{
- CreateServiceFunction(MS_UTILS_PATHTORELATIVE, pathToRelative);
- CreateServiceFunction(MS_UTILS_PATHTORELATIVEW, pathToRelativeW);
-
- CreateServiceFunction(MS_UTILS_PATHTOABSOLUTE, pathToAbsolute);
- CreateServiceFunction(MS_UTILS_PATHTOABSOLUTEW, pathToAbsoluteW);
-
- CreateServiceFunction(MS_UTILS_CREATEDIRTREE, createDirTree);
- CreateServiceFunction(MS_UTILS_CREATEDIRTREEW, createDirTreeW);
-
CreateServiceFunction(MS_UTILS_REPLACEVARS, replaceVars);
return 0;
}
diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp
index 6e17eaa53a..e9fb81c672 100644
--- a/src/mir_core/src/path.cpp
+++ b/src/mir_core/src/path.cpp
@@ -83,6 +83,9 @@ MIR_CORE_DLL(int) PathToAbsolute(const char *pSrc, char *pOut, const char *base)
MIR_CORE_DLL(void) CreatePathToFile(char *szFilePath)
{
+ if (szFilePath == NULL)
+ return;
+
char *pszLastBackslash = strrchr(szFilePath, '\\');
if (pszLastBackslash == NULL)
return;
@@ -94,6 +97,9 @@ MIR_CORE_DLL(void) CreatePathToFile(char *szFilePath)
MIR_CORE_DLL(int) CreateDirectoryTree(const char *szDir)
{
+ if (szDir == NULL)
+ return 1;
+
char szTestDir[MAX_PATH];
mir_strncpy(szTestDir, szDir, SIZEOF(szTestDir));
@@ -167,6 +173,9 @@ MIR_CORE_DLL(int) PathToAbsoluteW(const WCHAR *pSrc, WCHAR *pOut, const WCHAR *b
MIR_CORE_DLL(void) CreatePathToFileW(WCHAR *wszFilePath)
{
+ if (wszFilePath == NULL)
+ return;
+
WCHAR *pszLastBackslash = wcsrchr(wszFilePath, '\\');
if (pszLastBackslash == NULL)
return;
@@ -178,6 +187,9 @@ MIR_CORE_DLL(void) CreatePathToFileW(WCHAR *wszFilePath)
MIR_CORE_DLL(int) CreateDirectoryTreeW(const WCHAR *szDir)
{
+ if (szDir == NULL)
+ return 1;
+
WCHAR szTestDir[MAX_PATH];
mir_wstrncpy(szTestDir, szDir, SIZEOF(szTestDir));