From 512e305e20ce6bd867d3023d510f2d2e517d9a95 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Thu, 11 Jun 2015 19:33:30 +0200 Subject: [PATCH] When building assets, skip empty files. --- src/cli.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cli.c b/src/cli.c index 4477ccd..d44e1f9 100644 --- a/src/cli.c +++ b/src/cli.c @@ -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);