From: Junio C Hamano Date: Mon, 23 Jun 2008 22:38:11 GMT Subject: Re: [RFC] Re: Convert 'git blame' to parse_options() Message-ID: <7vmylbg4ks.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080623222404.GM13395@artemis.madism.org> Pierre Habouzit 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.