Re: [RFC] Re: Convert 'git blame' to parse_options()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 23, 2008, 22:38 UTC
- Message-ID
- <7vmylbg4ks.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080623222404.GM13395@artemis.madism.org>
Pierre Habouzit <madcoder@debian.org> writes:
> Though I didn't fixed the fact that parse_options clobbers argv[0], > which can be easily fixed. The issue with that is that _some_ callers > use the fact that the filtered argv is NULL terminated.
Isn't it just the matter of (1) leave argv[0] as is, (2) start copy dest at argv[1] not argv[0], and (3) terminate argv[nargc] = NULL where nargc is what you did not handle?
You have argc args in incoming argv[], you consume zero or more of them starting from argv[1] up to potentially argv[argc-1] (and argv[argc] is NULL). So why is it an issue? Sorry, I do not understand.