1
0
Fork 0

Merging upstream version 1.9.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 05:59:37 +01:00
parent 3e7d50525b
commit 13941d3cbe
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
30 changed files with 1188 additions and 1060 deletions

40
rc.cc
View file

@ -1,18 +1,18 @@
/* Zutils - Utilities dealing with compressed files
Copyright (C) 2009-2019 Antonio Diaz Diaz.
/* Zutils - Utilities dealing with compressed files
Copyright (C) 2009-2020 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
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
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
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _FILE_OFFSET_BITS 64
@ -37,12 +37,12 @@ int verbosity = 0;
namespace {
const char * const config_file_name = "zutilsrc";
const char * const program_year = "2019";
const char * const program_year = "2020";
std::string compressor_names[num_formats] =
{ "bzip2", "gzip", "lzip", "xz" }; // default compressor names
// args to compressors, maybe empty
// args to compressors read from rc or from options --[bglx]z, maybe empty
std::vector< std::string > compressor_args[num_formats];
// vector of enabled formats plus [num_formats] for uncompressed.
@ -93,10 +93,10 @@ bool trailing_escape( const std::string & s )
}
// Read a line discarding comments, leading whitespace and blank lines.
// Escaped newlines are discarded.
// Returns the empty string if at EOF.
//
/* Read a line discarding comments, leading whitespace, and blank lines.
Escaped newlines are discarded.
Returns the empty string if at EOF.
*/
const std::string & my_fgets( FILE * const f, int & linenum )
{
static std::string s;
@ -237,7 +237,7 @@ void parse_format_list( const std::string & arg )
enabled_formats[format_index] = true;
}
if( error )
{ show_error( "Bad argument for '--format' option." ); std::exit( 1 ); }
{ show_error( "Bad argument for option '--format'." ); std::exit( 1 ); }
}
@ -246,7 +246,7 @@ int parse_format_type( const std::string & arg )
for( int i = 0; i < num_formats; ++i )
if( arg == format_names[i] )
return i;
show_error( "Bad argument for '--force-format' option." );
show_error( "Bad argument for option '--force-format'." );
std::exit( 1 );
}