From: Junio C Hamano Date: Thu, 26 Jul 2007 06:53:24 GMT Subject: Re: [PATCH 1/5] Add is_absolute_path(), make_absolute_path() and normalize_path() Message-ID: <7v1wevac63.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: > +/* strip out .. and . */ > +char *normalize_path(char *path) > +{ This always makes one worry what should happen when foo/../bar is _not_ bar in reality (i.e. foo is symlink to a directory elsewhere). It depends on what kind of "path" you feed to the function (and its caller, make_absolute_path()). If you always feed a path from the index (or a path obtained by recursively reading a tree), it is Ok. If it is arbitrary path obtained from the user or the filesystem, it is not.