summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/winutil.c15
-rw-r--r--win32/winutil.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/win32/winutil.c b/win32/winutil.c
index 7e1cf3fc91..24b00edfae 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -31,3 +31,18 @@ PHPAPI char *php_win_err(int error)
return (buf ? (char *) buf : "");
}
+
+int php_win32_check_trailing_space(const char * path, const int path_len) {
+ if (path_len < 1) {
+ return 1;
+ }
+ if (path) {
+ if (path[0] == ' ' || path[path_len - 1] == ' ') {
+ return 0;
+ } else {
+ return 1;
+ }
+ } else {
+ return 0;
+ }
+}
diff --git a/win32/winutil.h b/win32/winutil.h
index 36b10200cb..8ee75752da 100644
--- a/win32/winutil.h
+++ b/win32/winutil.h
@@ -19,3 +19,4 @@
PHPAPI char *php_win_err(int error);
#define php_win_err() php_win_err(GetLastError())
+int php_win32_check_trailing_space(const char * path, const int path_len);