[syslinux] linux/syslinux.c: Double slash question
H. Peter Anvin
hpa at zytor.com
Sat Jun 19 08:59:47 PDT 2010
On 06/19/2010 08:06 AM, Gene Cumm wrote:
> Ever since commit b297348081ec40baed33e49fe5f46b54c0d7b164
> (http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commitdiff;h=b297348081ec40baed33e49fe5f46b54c0d7b164),
> the statements that build the path for ldlinux.sys have contained '//'
> instead of '/' as a path separator. Although it seems strange, it
> shouldn't have any effect on functionality.
>
> Is this in there because some compiler wanted to use '/' as an escape
> rather than '\' or is there some other reason I'm missing? The only
> reason I noticed this is that I was dumping out ldlinux_name to
> diagnose my previous error.
>
It doesn't matter for Linux, but some other POSIX operating systems use
a leading double slash as an escape. This can occur by accident in the
case the leading directory is / and an additional / is added as a
separator. However a *triple* slash isn't allowed to be an escape, so
using // as the separator avoids that.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
More information about the Syslinux
mailing list