[libdvdnav-devel] [PATCH 3/7] Use correct constant

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Thu May 21 12:44:45 CEST 2015


On Thu, 21 May 2015 11:36:58 +0300, Petri Hintukainen wrote:

> On to, 2015-05-21 at 11:39 +1200, Lawrence D'Oliveiro wrote:

>> Why is one of these “9-1” and the other “9”? Both strings are the
>> same length.
> 
> It preserves the slash in Windows. Without it ex. D:\VIDEO_TS would
> become D: , not D:\ . But, don't ask why it is needed (the code was
> like that before).

It could matter (or could have mattered) that “D:” means “current
directory on drive D”, while “D:\” means “root directory on drive D”.

> In most Unix-like systems trailing slash must be removed or mount
> point search won't work.

I had a look at the source for the mountpoint(1) command, and it will
work regardless of trailing slashes or repeated slashes.

> And there's another check that handles the special case when
> VIDEO_TS is directly under root ...

No doubt because under POSIX the pathname “/VIDEO_TS” is truncated to
the empty string, which is invalid.


More information about the libdvdnav-devel mailing list