summaryrefslogtreecommitdiffstats
path: root/carg_parser.c
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 14:57:30 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 14:57:30 +0000
commit4ce2757d33f1acbdd3f32bec58c79032776b2f68 (patch)
tree2083b4a0c3bf3cbc50321162b81aca049a887752 /carg_parser.c
parentAdding debian version 1.4-3. (diff)
downloadpdlzip-4ce2757d33f1acbdd3f32bec58c79032776b2f68.tar.xz
pdlzip-4ce2757d33f1acbdd3f32bec58c79032776b2f68.zip
Merging upstream version 1.5~rc1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'carg_parser.c')
-rw-r--r--carg_parser.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/carg_parser.c b/carg_parser.c
index 7ea8a2f..2958c67 100644
--- a/carg_parser.c
+++ b/carg_parser.c
@@ -1,4 +1,4 @@
-/* Pdlzip - Data compressor based on the LZMA algorithm
+/* Pdlzip - LZMA lossless data compressor
Copyright (C) 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
This program is free software: you have unlimited permission
@@ -72,15 +72,14 @@ static char parse_long_option( struct Arg_parser * const ap,
int * const argindp )
{
unsigned len;
- int index = -1;
- int i;
+ int index = -1, i;
char exact = 0, ambig = 0;
for( len = 0; opt[len+2] && opt[len+2] != '='; ++len ) ;
/* Test all long options for either exact match or abbreviated matches. */
for( i = 0; options[i].code != 0; ++i )
- if( options[i].name && !strncmp( options[i].name, &opt[2], len ) )
+ if( options[i].name && strncmp( options[i].name, &opt[2], len ) == 0 )
{
if( strlen( options[i].name ) == len ) /* Exact match found */
{ index = i; exact = 1; break; }
@@ -148,8 +147,7 @@ static char parse_short_option( struct Arg_parser * const ap,
while( cind > 0 )
{
- int index = -1;
- int i;
+ int index = -1, i;
const unsigned char code = opt[cind];
char code_str[2];
code_str[0] = code; code_str[1] = 0;