core, chdir: collapse slashes, avoid copy-to-self syslinux-4.00-pre64
authorH. Peter Anvin <hpa@zytor.com>
Mon, 28 Jun 2010 01:46:36 +0000 (18:46 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 28 Jun 2010 01:46:36 +0000 (18:46 -0700)
commit7e63729cfd781f69f7cb47b85cf8b1fee6b3e62a
tree4592aa54dc967b8a82b25546d20549dc71135a26
parent82fa68da1ae6d7bea7cd6d0d4dda883ef2c2fd3d
core, chdir: collapse slashes, avoid copy-to-self

Collapse multiple slashes into one (this still doesn't resolve . and
.. in the path, since that requires awareness of symlinks.)

This code also avoids a copy-over-self bug by introducing a temporary
buffer.

Reported-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/fs/chdir.c