]> granicus.if.org Git - php/commitdiff
Replace min() - not everyone has it
authorStanislav Malyshev <stas@php.net>
Sun, 6 Aug 2000 16:34:37 +0000 (16:34 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 6 Aug 2000 16:34:37 +0000 (16:34 +0000)
main/php_virtual_cwd.c

index 3dbb8fd629d6e8fe357f54c8cf87f7954d4172af..bf497d5003a723dd68463e2d08ed4abac931fc03 100644 (file)
 #include "win95nt.h"
 #endif
 
-#if HAVE_UTIME
-# ifdef PHP_WIN32
-#  include <sys/utime.h>
-# else
-#  include <utime.h>
-# endif
-#endif
-
-
 #include "php_virtual_cwd.h"
 #include "php_reentrancy.h" /* for php_strtok_r */
 
@@ -458,7 +449,7 @@ CWD_API char *virtual_realpath(char *path, char *real_path)
        retval = virtual_file_ex(&new_state, path, NULL);
        
        if(retval) {
-               int len = min(MAXPATHLEN-1,new_state.cwd_length);
+               int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
                memcpy(real_path, new_state.cwd, len);
                real_path[len] = '\0';
                return real_path;