From ae26a497b6a3b9948872ee9bd41b2484b0e05c94 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 10 Apr 2017 17:18:05 +0200 Subject: Adding upstream version 1.6. Signed-off-by: Daniel Baumann --- zgrep.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'zgrep.cc') diff --git a/zgrep.cc b/zgrep.cc index 6c8ceb1..5bcb968 100644 --- a/zgrep.cc +++ b/zgrep.cc @@ -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; } -- cgit v1.2.3