Why does canonicalize call collapse after realpath?
30 Apr
2014
30 Apr
'14
11:33 p.m.
canonicalize_md.c does: /* First try realpath() on the entire path */ if (realpath(original, resolved)) { /* That worked, so return it */ collapse(resolved); return 0; } And collapse promises to remove /./ and /../ BUT realpath should have already done that: http://pubs.opengroup.org/onlinepubs/009696899/functions/realpath.html The *realpath*() function shall derive, from the pathname pointed to by *file_name*, an absolute pathname that names the same file, whose resolution does not involve '.', '..', or symbolic links. (although it's true that collapse is not the expensive part of the operation...)
4333
Age (days ago)
4333
Last active (days ago)
0 comments
1 participants
participants (1)
-
Martin Buchholz