summaryrefslogtreecommitdiff
path: root/main/php_realpath.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-11 15:59:30 +0000
committerZeev Suraski <zeev@php.net>2000-02-11 15:59:30 +0000
commit80bdd19e031ca0dac2dfd4cb62ff43558d477663 (patch)
tree539fd5059d50e32acf9b991354d48cbcecb16426 /main/php_realpath.c
parent80f4886c5a71b0cdc4a3159297160e30ddd298cb (diff)
downloadphp-git-80bdd19e031ca0dac2dfd4cb62ff43558d477663.tar.gz
Fine tune Andi's patch
Diffstat (limited to 'main/php_realpath.c')
-rw-r--r--main/php_realpath.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main/php_realpath.c b/main/php_realpath.c
index c6edfb0cca..1385893ce0 100644
--- a/main/php_realpath.c
+++ b/main/php_realpath.c
@@ -40,7 +40,7 @@ char *php_realpath(char *path, char resolved_path []) {
char path_copy[MAXPATHLEN]; /* A work-copy of the path */
char *workpos; /* working position in *path */
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
char buf[MAXPATHLEN]; /* Buffer for readlink */
int linklength; /* The result from readlink */
#endif
@@ -48,7 +48,7 @@ char *php_realpath(char *path, char resolved_path []) {
struct stat filestat; /* result from stat */
-#if PHP_WIN32
+#ifdef PHP_WIN32
char *temppos; /* position while counting '.' */
int dotcount; /* number of '.' */
int t; /* counter */
@@ -58,7 +58,7 @@ char *php_realpath(char *path, char resolved_path []) {
strcpy(path_copy, path);
workpos = path_copy;
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* Find out where we start - Windows version */
if ((*workpos == '\\') || (*workpos == '/')) {
/* We start at the root of the current drive */
@@ -109,13 +109,13 @@ char *php_realpath(char *path, char resolved_path []) {
/* Go to the end, then stop */
while(*workpos != 0) {
/* Strip (back)slashes */
-#if PHP_WIN32
+#ifdef PHP_WIN32
while(*workpos == '\\') workpos++;
#else
while(*workpos == '/') workpos++;
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* reset dotcount */
dotcount = 0;
@@ -169,7 +169,7 @@ char *php_realpath(char *path, char resolved_path []) {
*writepos++ = *workpos++;
}
*writepos = 0;
-#else /* PHP_WIN32 */
+#else /* defined(PHP_WIN32) */
/* Look for .. */
if ((workpos[0] == '.') && (workpos[1] != 0)) {
if ((workpos[1] == '.') && ((workpos[2] == '/') || (workpos[2] == 0))) {
@@ -247,7 +247,7 @@ char *php_realpath(char *path, char resolved_path []) {
*writepos++ = *workpos++;
}
*writepos = 0;
-#endif /* PHP_WIN32 */
+#endif /* defined(PHP_WIN32) */
}
/* Check if the resolved path is a directory */