When building assets, skip empty files.

This commit is contained in:
Joris Vink 2015-06-11 19:33:30 +02:00
parent 81d119ff93
commit 512e305e20
1 changed files with 6 additions and 0 deletions

View File

@ -601,6 +601,12 @@ cli_build_asset(char *fpath, struct dirent *dp)
if (stat(fpath, &st) == -1)
cli_fatal("stat: %s %s", fpath, errno_s);
/* If this file was empty, skip it. */
if (st.st_size == 0) {
printf("skipping empty asset %s\n", name);
return;
}
(void)cli_vasprintf(&opath, "%s/.objs/%s.o", rootdir, name);
(void)cli_vasprintf(&cpath, "%s/.objs/%s.c", rootdir, name);