summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-24 14:36:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-24 14:36:23 +0000
commita8fd33c7efd6f25fb6127467ad6547bd8e9c995a (patch)
treeca95eb35cf80d55167eaa04e285b27e41f3070b6 /src
parent7e7bb5ea2b5c5f72de0fff129a22c93f90afebd9 (diff)
minor code reorganization
git-svn-id: http://svn.miranda-ng.org/main/trunk@9931 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/path.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mir_core/path.cpp b/src/mir_core/path.cpp
index e3d6093bb2..4eb54b594b 100644
--- a/src/mir_core/path.cpp
+++ b/src/mir_core/path.cpp
@@ -31,10 +31,9 @@ static TCHAR szMirandaPathW[MAX_PATH];
MIR_CORE_DLL(int) PathIsAbsolute(const char *path)
{
- if (strlen(path) <= 2)
- return 0;
- if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
- return 1;
+ if (path && strlen(path) > 2)
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
+ return 1;
return 0;
}
@@ -118,10 +117,9 @@ MIR_CORE_DLL(int) CreateDirectoryTree(const char *szDir)
MIR_CORE_DLL(int) PathIsAbsoluteW(const TCHAR *path)
{
- if (lstrlen(path) <= 2)
- return 0;
- if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
- return 1;
+ if (path && _tcslen(path) > 2)
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
+ return 1;
return 0;
}