Code

parse-options: fix segmentation fault when a required value is missing
authorOlivier Marin <dkr@freesurf.fr>
Mon, 21 Jul 2008 18:30:36 +0000 (20:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Jul 2008 04:20:04 +0000 (21:20 -0700)
commitd5d745f90b929310f3893bb8b3766cc1745140c8
treede67ef03b447f77d5484f45b2288b73dede8383b
parent0d4ede9f5493f0e15fb4f799e6a4a25e36c49fd2
parse-options: fix segmentation fault when a required value is missing

p->argc represent the number of arguments that have not been parsed yet,
_including_ the one we are currently parsing. If it is not greater than
one then there is no more argument.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Acked-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c
t/t0040-parse-options.sh