- fd = dup (atoi (path));
- else if (!strcmp (path, "-"))
- fd = dup (0);
+ {
+ char *end;
+ int oldfd = strtol (p_access->psz_location, &end, 10);
+
+ if (*end == '\0')
+ fd = vlc_dup (oldfd);
+ else if (*end == '/' && end > p_access->psz_location)
+ {
+ char *name = decode_URI_duplicate (end - 1);
+ if (name != NULL)
+ {
+ name[0] = '.';
+ fd = vlc_openat (oldfd, name, O_RDONLY | O_NONBLOCK);
+ free (name);
+ }
+ }
+ }