diff src/http/ngx_http_script.c @ 218:1bf60f8c5c9e NGINX_0_3_56

nginx 0.3.56 *) Feature: the "dav_access" directive. *) Feature: the "if" directive supports the "-d", "!-d", "-e", "!-e", "-x", and "!-x" operators. *) Bugfix: a segmentation fault occurred if an request returned an redirect and some sent to client header lines were logged in the access log.
author Igor Sysoev <http://sysoev.ru>
date Fri, 04 Aug 2006 00:00:00 +0400
parents 2a97b47ff8db
children 559bc7ec214e
line wrap: on
line diff
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -961,8 +961,13 @@ ngx_http_script_file_code(ngx_http_scrip
 
         switch (code->op) {
         case ngx_http_script_file_plain:
+        case ngx_http_script_file_dir:
+        case ngx_http_script_file_exists:
+        case ngx_http_script_file_exec:
              goto false;
         case ngx_http_script_file_not_plain:
+        case ngx_http_script_file_not_dir:
+        case ngx_http_script_file_not_exec:
              goto true;
         }
 
@@ -981,6 +986,54 @@ ngx_http_script_file_code(ngx_http_scrip
             goto false;
         }
         goto true;
+
+    case ngx_http_script_file_dir:
+        if (ngx_is_dir(&fi)) {
+             goto true;
+        }
+        goto false;
+
+    case ngx_http_script_file_not_dir:
+        if (ngx_is_dir(&fi)) {
+            goto false;
+        }
+        goto true;
+
+    case ngx_http_script_file_exists:
+        if (ngx_is_file(&fi) || ngx_is_dir(&fi) || ngx_is_link(&fi)) {
+             goto true;
+        }
+        goto false;
+
+    case ngx_http_script_file_not_exists:
+        if (ngx_is_file(&fi) || ngx_is_dir(&fi) || ngx_is_link(&fi)) {
+            goto false;
+        }
+        goto true;
+
+#if (NGX_WIN32)
+
+    case ngx_http_script_file_exec:
+        goto false;
+
+    case ngx_http_script_file_not_exec:
+        goto true;
+
+#else
+
+    case ngx_http_script_file_exec:
+        if (ngx_is_exec(&fi)) {
+             goto true;
+        }
+        goto false;
+
+    case ngx_http_script_file_not_exec:
+        if (ngx_is_exec(&fi)) {
+            goto false;
+        }
+        goto true;
+
+#endif
     }
 
 false: