From c173f71f8e7d48b8511825e0790ca1e774c9f04c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 15:58:52 +0100 Subject: Merging upstream version 1.6~rc1. Signed-off-by: Daniel Baumann --- carg_parser.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'carg_parser.c') 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; -- cgit v1.2.3