From 0a1294758d30a52b18944b04a1d285fa5a4adc3f Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 12 Oct 2017 11:44:14 -0500 Subject: [PATCH] Replace opts.stdout with opts.to_stdout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason on Solaris the previous code was refusing to compile with an error (regarding the declaration of stdout in the opts struct) error: declaration of ‘__iob’ as array of references The obvious guess that it had something to do with the name of the variable in question proved true; renaming it from `stdout` to `opts.stdout` allows the build to go through. --- src/builtin_read.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/builtin_read.cpp b/src/builtin_read.cpp index ef26ceed3..13d85fad1 100644 --- a/src/builtin_read.cpp +++ b/src/builtin_read.cpp @@ -47,7 +47,7 @@ struct read_cmd_opts_t { bool array = false; bool silent = false; bool split_null = false; - bool stdout = false; + bool to_stdout = false; int nchars = 0; }; @@ -74,7 +74,7 @@ static const struct woption long_options[] = {{L"export", no_argument, NULL, 'x' static int parse_cmd_opts(read_cmd_opts_t &opts, int *optind, //!OCLINT(high ncss method) int argc, wchar_t **argv, parser_t &parser, io_streams_t &streams) { if (argc == 1) { - opts.stdout = true; + opts.to_stdout = true; return STATUS_CMD_OK; } @@ -405,7 +405,7 @@ int builtin_read(parser_t &parser, io_streams_t &streams, wchar_t **argv) { int optind; int retval = parse_cmd_opts(opts, &optind, argc, argv, parser, streams); if (retval != STATUS_CMD_OK) return retval; - if (!opts.stdout) { + if (!opts.to_stdout) { argc -= optind; argv += optind; } @@ -440,7 +440,7 @@ int builtin_read(parser_t &parser, io_streams_t &streams, wchar_t **argv) { return exit_res; } - if (opts.stdout) { + if (opts.to_stdout) { write_stdout(buff); return exit_res; }