nginx-0.0.1-2003-07-18-18:44:05 import
diff --git a/src/core/nginx.c b/src/core/nginx.c
index ce2e30a..4bc9a21 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -71,7 +71,12 @@
     ngx_core_conf_t  *ccf;
 
 #if (NGX_DEBUG) && (__FreeBSD__)
-    malloc_options = "J";
+#if __FreeBSD_version >= 500014
+    _malloc_options
+#else
+    malloc_options
+#endif
+                    = "J";
 #endif
 
     /* TODO */ ngx_max_sockets = -1;
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index ae4231f..bea7a4c 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -127,6 +127,7 @@
                     && ngx_strcmp(name->data, cmd->name.data) == 0)
                 {
 
+                    found = 1;
 #if 0
 ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
 #endif
@@ -204,7 +205,6 @@
 #endif
 
                     if (rv == NGX_CONF_OK) {
-                        found = 1;
                         break;
 
                     } else if (rv == NGX_CONF_ERROR) {
@@ -220,7 +220,7 @@
                                          cf->conf_file->line);
                         } else {
                             ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                                         "%s %s in %s:%d",
+                                         "\"%s\" directive %s in %s:%d",
                                          name->data, rv,
                                          cf->conf_file->file.name.data,
                                          cf->conf_file->line);
@@ -245,6 +245,10 @@
             rc = NGX_ERROR;
             break;
         }
+
+        if (rc == NGX_ERROR) {
+            break;
+        }
     }
 
     if (filename) {
@@ -471,6 +475,30 @@
 }
 
 
+void ngx_conf_log_error(int level, ngx_conf_t *cf, ngx_err_t err,
+                        char *fmt, ...)
+{
+    int      len;
+    char     errstr[MAX_CONF_ERRSTR];
+    va_list  args;
+
+    va_start(args, fmt);
+    len = ngx_vsnprintf(errstr, sizeof(errstr) - 1, fmt, args);
+    va_end(args);
+
+    if (err) {
+        len += ngx_snprintf(errstr + len, sizeof(errstr) - len - 1,
+                            " (%d: ", err);
+        len += ngx_strerror_r(err, errstr + len, sizeof(errstr) - len - 1);
+        errstr[len++] = ')';
+        errstr[len++] = '\0';
+    }
+
+    ngx_log_error(level, cf->log, 0, "%s in %s:%d",
+                  errstr, cf->conf_file->file.name.data, cf->conf_file->line);
+}
+
+
 char *ngx_conf_set_core_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd,
                                   void *conf)
 {
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index 6f6a92a..f618d9b 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -124,6 +124,7 @@
 #define ngx_get_conf(conf_ctx, module)  conf_ctx[module.index]
 
 
+
 #define ngx_conf_init_value(conf, default)                                   \
     if (conf == NGX_CONF_UNSET) {                                            \
         conf = default;                                                      \
@@ -177,6 +178,10 @@
 char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
 
 
+void ngx_conf_log_error(int level, ngx_conf_t *cf, ngx_err_t err,
+                        char *fmt, ...);
+
+
 char *ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 char *ngx_conf_set_str_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 char *ngx_conf_set_num_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
@@ -185,7 +190,7 @@
 char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 
 char *ngx_conf_set_core_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd,
-                                                                   void *conf);
+                                  void *conf);
 
 extern ngx_module_t     *ngx_modules[];
 extern ngx_cycle_t      *ngx_cycle;