Re: [RFC 0/2] refactor relative_path in path.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 15, 2013, 18:24 UTC
- Message-ID
- <7vli7gaypc.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <cover.1368630636.git.worldhello.net@gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 6 quoted lines
> These two patches enhance relative_path() in path.c, so that function > relative_path() will return real relative path, not a path strip off > the prefix. > > The 2nd patch is a bit aggressive, it refactor all related functions, > remove unnecessary arguments: len and/or prefix_len.
I did not particularly find the second one "aggressive"; it would have been much more pleasant to review if the "drop unused 'len'" part were made into a separate patch [3/2] as a follow-up, though.
It is a bit sad that relative_path() in [1/2] uses a single static and fixed sized buffer. How is the new implementation making sure the expanded result does not overflow the buf[]?