]> git.kaiwu.me - nginx.git/commitdiff
allow perl "sub{..."
authorIgor Sysoev <igor@sysoev.ru>
Tue, 15 Sep 2009 09:37:16 +0000 (09:37 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 15 Sep 2009 09:37:16 +0000 (09:37 +0000)
src/http/modules/perl/ngx_http_perl_module.c

index 634801eced0c06603170a604a462ef992c111cb1..41372ce2d03f1ca240b8c3d76524f6a878b116c3 100644 (file)
@@ -761,7 +761,10 @@ ngx_http_perl_eval_anon_sub(pTHX_ ngx_str_t *handler, SV **sv)
         }
     }
 
-    if (ngx_strncmp(p, "sub ", 4) == 0 || ngx_strncmp(p, "use ", 4) == 0) {
+    if (ngx_strncmp(p, "sub ", 4) == 0
+        || ngx_strncmp(p, "sub{", 4) == 0
+        || ngx_strncmp(p, "use ", 4) == 0)
+    {
         *sv = eval_pv((char *) p, FALSE);
 
         /* eval_pv() does not set ERRSV on failure */