summaryrefslogtreecommitdiffstats
path: root/carg_parser.c
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 14:58:52 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 14:58:52 +0000
commitc173f71f8e7d48b8511825e0790ca1e774c9f04c (patch)
tree0efd97c687c50a173dadea9ed8b9a7160884bf4e /carg_parser.c
parentAdding debian version 1.5-3. (diff)
downloadpdlzip-c173f71f8e7d48b8511825e0790ca1e774c9f04c.tar.xz
pdlzip-c173f71f8e7d48b8511825e0790ca1e774c9f04c.zip
Merging upstream version 1.6~rc1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'carg_parser.c')
-rw-r--r--carg_parser.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/carg_parser.c b/carg_parser.c
index b266751..8d74ea6 100644
--- a/carg_parser.c
+++ b/carg_parser.c
@@ -1,10 +1,18 @@
-/* Pdlzip - LZMA lossless data compressor
- Copyright (C) 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
+/* Arg_parser - POSIX/GNU command line argument parser. (C version)
+ Copyright (C) 2006-2015 Antonio Diaz Diaz.
- This program is free software: you have unlimited permission
- to copy, distribute and modify it.
+ This library is free software. Redistribution and use in source and
+ binary forms, with or without modification, are permitted provided
+ that the following conditions are met:
- This program is distributed in the hope that it will be useful,
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ This library 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.
*/
@@ -28,7 +36,7 @@ static char push_back_record( struct Arg_parser * const ap,
const int code, const char * const argument )
{
const int len = strlen( argument );
- struct ap_Record *p;
+ struct ap_Record * p;
void * tmp = ap_resize_buffer( ap->data,
( ap->data_size + 1 ) * sizeof (struct ap_Record) );
if( !tmp ) return 0;
@@ -159,7 +167,8 @@ static char parse_short_option( struct Arg_parser * const ap,
if( index < 0 )
{
- add_error( ap, "invalid option -- " ); add_error( ap, code_str );
+ add_error( ap, "invalid option -- '" ); add_error( ap, code_str );
+ add_error( ap, "'" );
return 1;
}
@@ -174,8 +183,8 @@ static char parse_short_option( struct Arg_parser * const ap,
{
if( !arg || !arg[0] )
{
- add_error( ap, "option requires an argument -- " );
- add_error( ap, code_str );
+ add_error( ap, "option requires an argument -- '" );
+ add_error( ap, code_str ); add_error( ap, "'" );
return 1;
}
++*argindp; cind = 0;