diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-04-10 15:18:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-04-10 15:18:05 +0000 |
commit | ae26a497b6a3b9948872ee9bd41b2484b0e05c94 (patch) | |
tree | 507308d272ce14e1a7d2600a43b92c4a3fff47f0 /zgrep.cc | |
parent | Adding upstream version 1.5. (diff) | |
download | zutils-ae26a497b6a3b9948872ee9bd41b2484b0e05c94.tar.xz zutils-ae26a497b6a3b9948872ee9bd41b2484b0e05c94.zip |
Adding upstream version 1.6.upstream/1.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zgrep.cc')
-rw-r--r-- | zgrep.cc | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ /* Zgrep - search compressed files for a regular expression - Copyright (C) 2010-2016 Antonio Diaz Diaz. + Copyright (C) 2010-2017 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 @@ -53,7 +53,7 @@ void show_help() "does not exist, and its name does not end with one of the known\n" "extensions, zgrep tries the compressed file names corresponding to the\n" "supported formats.\n" - "\nIf no files are specified, or if a file is specified as '-', data is\n" + "\nIf no files are specified, or if a file is specified as '-', data are\n" "read from standard input, decompressed if needed, and fed to grep. Data\n" "read from standard input must be of the same type; all uncompressed or\n" "all in the same compression format.\n" @@ -106,7 +106,7 @@ int zgrep_stdin( int infd, const int format_index, const std::vector< const char * > & grep_args ) { Children children; - if( !set_data_feeder( &infd, children, format_index ) ) return 2; + if( !set_data_feeder( "", &infd, children, format_index ) ) return 2; const pid_t grep_pid = fork(); if( grep_pid == 0 ) // child (grep) { @@ -141,7 +141,8 @@ int zgrep_file( int infd, const int format_index, const int list_mode, const bool show_name ) { Children children; - if( !set_data_feeder( &infd, children, format_index ) ) return 2; + if( !set_data_feeder( input_filename, &infd, children, format_index ) ) + return 2; int fda[2]; // pipe from grep if( pipe( fda ) < 0 ) { show_error( "Can't create pipe", errno ); return 2; } |