summaryrefslogtreecommitdiffstats
path: root/zupdate.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:37:53 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:37:53 +0000
commit77a9a9d380625670cd181c996aeb81343111a29d (patch)
tree566501beb43d4e2ed83350d70dfe8b9e5e886cb9 /zupdate.cc
parentAdding upstream version 1.3~pre1. (diff)
downloadzutils-77a9a9d380625670cd181c996aeb81343111a29d.tar.xz
zutils-77a9a9d380625670cd181c996aeb81343111a29d.zip
Adding upstream version 1.3~pre2.upstream/1.3_pre2
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'zupdate.cc')
-rw-r--r--zupdate.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/zupdate.cc b/zupdate.cc
index cf488da..2b3244b 100644
--- a/zupdate.cc
+++ b/zupdate.cc
@@ -136,14 +136,13 @@ struct { const char * from; const char * to; int format_index; } const
{ ".txz", ".tar", fmt_xz },
{ 0, 0, -1 } };
-int disable_xz = -1; // tri-state bool
-
// Returns 0 for success, -1 for file skipped, 1 for error.
int zupdate_file( const std::string & name, const char * const lzip_name,
const std::vector< std::string > & lzip_args2,
const bool force, const bool keep_input_files )
{
+ static int disable_xz = -1; // tri-state bool
int format_index = -1;
std::string dname; // decompressed_name
@@ -167,7 +166,7 @@ int zupdate_file( const std::string & name, const char * const lzip_name,
}
}
const char * const compressor_name = get_compressor_name( format_index );
- if( !compressor_name || !compressor_name[0] )
+ if( !compressor_name )
{
if( verbosity >= 2 )
std::fprintf( stderr, "%s: Unknown extension in file name '%s' -- ignored.\n",
@@ -384,7 +383,7 @@ int main( const int argc, const char * const argv[] )
#endif
const char * const lzip_name = get_compressor_name( fmt_lz );
- if( !lzip_name || !lzip_name[0] )
+ if( !lzip_name )
{ show_error( "Missing name of compressor for lzip format." ); return 1; }
for( ; argind < parser.arguments(); ++argind )