]> Trent Huber's Code - cbs.git/commitdiff
build() bug fix
authorTrent Huber <trentmhuber@gmail.com>
Mon, 21 Jul 2025 03:47:03 +0000 (23:47 -0400)
committerTrent Huber <trentmhuber@gmail.com>
Mon, 21 Jul 2025 03:47:03 +0000 (23:47 -0400)
cbs.c

diff --git a/cbs.c b/cbs.c
index 40f4143c084a75f253b0b86d965b1d78cad71899..d3e7b72b567186592f78d6a1cea4ae8b075084c6 100644 (file)
--- a/cbs.c
+++ b/cbs.c
@@ -158,7 +158,7 @@ void build(char *path) {
 
    if (stat("build.c", &src) == -1)
        err(EXIT_FAILURE, "Unable to stat `build.c'");
-   if (stat("build.o", &obj) == -1 && src.st_mtime > obj.st_mtime) {
+   if (stat("build.o", &obj) == -1 || src.st_mtime > obj.st_mtime) {
        compile("build");
        load('x', "build", (char *[]){"build", NULL});
    } else if (!path) return;