Andy Black wrote:
> 
> I recently noticed that the %P macro variable on Windows behaves 
> differently when the path is at the top (or root) directory than when 
> the path contains a directory.  When it is at the root, it ends with a 
> backslash (e.g. "E:\") whereas when it contains a directory, it does not 
> end with a backslash (e.g. "E:\My Data").  The documentation (in 
> commands.pdf at section 4.1.2) says that for the %p variable, the URL 
> does not end with a '/', but does not say what to expect with the %P 
> variable.
> 
> Is this behavior to be expected for the %P variable or is this a bug?
> 

There is no bug here and there is no way to be 100% consistent. See below.

The URL of a directory is expected to end with '/'. However, %p never
ends with '/' (except for the root directory whose name is '/'). That's
why this needs to be documented,

The filename of a directory is *not* expected to end with '/' (or '\' on
Windows). That's why this does not need to be documented,

Note the filename of the root directory of a filesystem is always
singular. This filename is '/' on Unix and something like c:\ on
windows. That is, %P necessarily ends with '/' (or '\' on Windows) for
the root directory of a filesystem.


Reply via email to