summaryrefslogtreecommitdiffstats
path: root/zgrep.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-04-10 15:19:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-04-10 15:19:00 +0000
commit6e01d7d8f65270f174ed4f161a5292aa5b89be0c (patch)
treeb73c1aad1d4cf13aad03fb2764f8123f266d27b4 /zgrep.cc
parentReleasing debian version 1.5-5. (diff)
downloadzutils-6e01d7d8f65270f174ed4f161a5292aa5b89be0c.tar.xz
zutils-6e01d7d8f65270f174ed4f161a5292aa5b89be0c.zip
Merging upstream version 1.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zgrep.cc')
-rw-r--r--zgrep.cc9
1 files changed, 5 insertions, 4 deletions
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; }