At Mon, 13 Sep 2021 16:06:52 +0900, Michael Paquier <michael@paquier.xyz> wrote in
> On Sun, Sep 12, 2021 at 07:33:23AM +0000, wangsh.fnst@fujitsu.com wrote:
> > 0001 is a small fix, because I find that is_absolute_path is not appropriate,
> > see comment in skip_drive:
> > > * On Windows, a path may begin with "C:" or "//network/".
>
> #define is_absolute_path(filename) \
> ( \
> - IS_DIR_SEP((filename)[0]) || \
> + (IS_DIR_SEP((filename)[0]) && IS_DIR_SEP((filename)[1])) || \
> (isalpha((unsigned char) ((filename)[0])) && (filename)[1] == ':' && \
> IS_DIR_SEP((filename)[2])) \
> With this change you would consider a path beginning with "/foo/.." as
> not being an absolute path, but that's not correct. Or am I missing
> something obvious?
Mmm. I haven't thought that so seriously, but '/hoge/foo/bar' doesn't
seem to be an absolute path on Windows since it lacks
"<dirver-letter>:" or "//hostname" part. If we're on drive D:,
"/Program\ Files" doesn't mean "C:\Program\ Files" but "D:\Program\
Files".
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center