Re: [PATCH 2/3] ls-files --others --directory: give trailing slash
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jan 7, 2006, 23:35 UTC
- Message-ID
- <Pine.LNX.4.64.0601071533060.3169@g5.osdl.org>
- In-Reply-To
- <7vy81racv7.fsf@assigned-by-dhcp.cox.net>
On Sat, 7 Jan 2006, Junio C Hamano wrote:
> > * Likes, dislikes? This suits better for *my* purpose of > calling this from git-status, but it might be undesirable for > your Porcelain.
Likes.
However, I'd re-write it as just
memcpy(fullname + baselen + len, "/", 2); len++; if (show_other_directories && !dir_exists(fullname, baselen + len)) break; read_directory(fullname, fullname, baselen + len);
because let's face it, every user wants the "+1", so just do it once up-front instead of adding one in three different places.
Linus