summaryrefslogtreecommitdiffstats
path: root/arg_parser.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:21:04 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:21:04 +0000
commit8ea0538d70bde5c4759fce0f5bda0684517d6d92 (patch)
treece7908218be1fc93e32bdfa1a274358770b7ebb0 /arg_parser.cc
parentAdding debian version 1.13-4. (diff)
downloadlziprecover-8ea0538d70bde5c4759fce0f5bda0684517d6d92.tar.xz
lziprecover-8ea0538d70bde5c4759fce0f5bda0684517d6d92.zip
Merging upstream version 1.14~rc1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'arg_parser.cc')
-rw-r--r--arg_parser.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/arg_parser.cc b/arg_parser.cc
index b3fd48d..a28d2ba 100644
--- a/arg_parser.cc
+++ b/arg_parser.cc
@@ -1,5 +1,5 @@
/* Arg_parser - POSIX/GNU command line argument parser. (C++ version)
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Antonio Diaz Diaz.
This library is free software: you can redistribute it and/or modify
@@ -36,7 +36,7 @@
bool Arg_parser::parse_long_option( const char * const opt, const char * const arg,
const Option options[], int & argind )
{
- unsigned int len;
+ unsigned len;
int index = -1;
bool exact = false, ambig = false;
@@ -44,7 +44,7 @@ bool Arg_parser::parse_long_option( const char * const opt, const char * const a
// Test all long options for either exact match or abbreviated matches.
for( int i = 0; options[i].code != 0; ++i )
- if( options[i].name && !std::strncmp( options[i].name, &opt[2], len ) )
+ if( options[i].name && std::strncmp( options[i].name, &opt[2], len ) == 0 )
{
if( std::strlen( options[i].name ) == len ) // Exact match found
{ index = i; exact = true; break; }
@@ -178,7 +178,7 @@ Arg_parser::Arg_parser( const int argc, const char * const argv[],
if( error_.size() ) data.clear();
else
{
- for( unsigned int i = 0; i < non_options.size(); ++i )
+ for( unsigned i = 0; i < non_options.size(); ++i )
{ data.push_back( Record() ); data.back().argument.swap( non_options[i] ); }
while( argind < argc )
{ data.push_back( Record() ); data.back().argument = argv[argind++]; }