Fixed bug in copying script files from absolute locations

This commit is contained in:
jkh 1993-09-06 23:28:42 +00:00
parent ce70f09a1a
commit b6ff6e9619

View File

@ -110,8 +110,14 @@ write_file(char *name, char *str)
void
copy_file(char *dir, char *fname, char *to)
{
if (vsystem("cp -p -r %s/%s %s", dir, fname, to))
barf("Couldn't copy %s/%s to %s!", dir, fname, to);
char cmd[FILENAME_MAX];
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);
}
/*