mshow: don't extract to absolute paths

duh.
pull/1/merge
Christian Neukirchen 8 years ago
parent 9545981777
commit d52fa6bf4d

@ -308,10 +308,18 @@ static int extract_argc;
static char **extract_argv;
static int extract_stdout;
static const char *
basenam(const char *s)
{
char *r = strrchr(s, '/');
return r ? r + 1 : s;
}
static int
writefile(char *name, char *buf, ssize_t len)
{
int fd = open(name, O_CREAT | O_EXCL | O_WRONLY, 0666);
int fd = open(basenam(name), O_CREAT | O_EXCL | O_WRONLY, 0666);
if (fd == -1) {
perror("open");
return -1;

Loading…
Cancel
Save