Fixed bug in copying script files from absolute locations
This commit is contained in:
parent
3b6c96ab2f
commit
3e88a4ee85
@ -110,8 +110,14 @@ write_file(char *name, char *str)
|
|||||||
void
|
void
|
||||||
copy_file(char *dir, char *fname, char *to)
|
copy_file(char *dir, char *fname, char *to)
|
||||||
{
|
{
|
||||||
if (vsystem("cp -p -r %s/%s %s", dir, fname, to))
|
char cmd[FILENAME_MAX];
|
||||||
barf("Couldn't copy %s/%s to %s!", dir, fname, to);
|
|
||||||
|
if (fname[0] == '/')
|
||||||
|
sprintf(cmd, "cp -p -r %s %s", fname, to);
|
||||||
|
else
|
||||||
|
sprintf(cmd, "cp -p -r %s/%s %s", dir, fname, to);
|
||||||
|
if (vsystem(cmd))
|
||||||
|
barf("Couldn't perform '%s'", cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user