Re: [PATCH 2/8] Add functions get_relative_cwd() and is_inside_dir()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 27, 2007, 20:51 UTC
- Message-ID
- <7vps2dy3hb.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0707271956140.14781@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 9 quoted lines
> +char *get_relative_cwd(char *buffer, int size, const char *dir)
> +{
> + char *cwd = buffer;
> +
> + if (!dir)
> + return 0;
> +
> + if (!getcwd(buffer, PATH_MAX))
> + return 0;Can size be less than PATH_MAX?