[njs] Shell: avoid reporting filenames in exception is quiet mode.

Dmitry Volyntsev xeioex at nginx.com
Fri Feb 8 17:20:22 UTC 2019


details:   https://hg.nginx.org/njs/rev/7978bb236657
branches:  
changeset: 770:7978bb236657
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Feb 08 20:14:55 2019 +0300
description:
Shell: avoid reporting filenames in exception is quiet mode.

diffstat:

 njs/njs_shell.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (21 lines):

diff -r cb7ccf9edc68 -r 7978bb236657 njs/njs_shell.c
--- a/njs/njs_shell.c	Fri Feb 08 20:06:05 2019 +0300
+++ b/njs/njs_shell.c	Fri Feb 08 20:14:55 2019 +0300
@@ -214,11 +214,13 @@ main(int argc, char **argv)
 
     nxt_memzero(&vm_options, sizeof(njs_vm_opt_t));
 
-    if (opts.file != NULL) {
-        nxt_file_name(&vm_options.file, opts.file);
+    if (!opts.quiet) {
+        if (opts.file != NULL) {
+            nxt_file_name(&vm_options.file, opts.file);
 
-    } else {
-        vm_options.file = nxt_string_value("shell");
+        } else {
+            vm_options.file = nxt_string_value("shell");
+        }
     }
 
     vm_options.init = !opts.interactive;


More information about the nginx-devel mailing list