diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-01-04 11:13:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-01-04 11:13:03 +0000 |
commit | 74f3e49ba198016d7d078fbaf4954323f2cb3a15 (patch) | |
tree | 3be3ee4bf92eb1d9c3576e6019aa0010015c0161 /zcatgrep.cc | |
parent | Releasing debian version 1.7-8. (diff) | |
download | zutils-74f3e49ba198016d7d078fbaf4954323f2cb3a15.tar.xz zutils-74f3e49ba198016d7d078fbaf4954323f2cb3a15.zip |
Merging upstream version 1.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zcatgrep.cc')
-rw-r--r-- | zcatgrep.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zcatgrep.cc b/zcatgrep.cc index ad75f14..10bc1ea 100644 --- a/zcatgrep.cc +++ b/zcatgrep.cc @@ -1,5 +1,5 @@ /* Common code for zcat and zgrep - Copyright (C) 2010-2018 Antonio Diaz Diaz. + Copyright (C) 2010-2019 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,6 +39,7 @@ int open_instream( std::string & input_filename, const bool search, int infd = open( input_filename.c_str(), O_RDONLY | O_BINARY ); if( infd < 0 ) { + const int saved_errno = errno; if( search && simple_extension_index( input_filename ) < 0 ) { for( int i = 0; i < num_formats; ++i ) @@ -51,7 +52,8 @@ int open_instream( std::string & input_filename, const bool search, } } if( infd < 0 && !no_messages ) - show_error2( "Can't open input file", input_filename.c_str() ); + show_file_error( input_filename.c_str(), "Can't open input file", + saved_errno ); } return infd; } |