From b54f0119fc14626ac72662aea0fec4661de4b975 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Wed, 4 Feb 2026 16:20:29 +0000 Subject: [PATCH] use older stat tools. TurboC doesn't know what S_ISDIR is --- .gitignore | 1 + src/cnadd.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fb12ca9..48900b0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .grok/ .idea/ .vscode/ +.DS_Store build/ diff --git a/src/cnadd.c b/src/cnadd.c index 32a3d03..4413542 100644 --- a/src/cnadd.c +++ b/src/cnadd.c @@ -11,8 +11,8 @@ int ensure_directory_exists(const char *path) { struct stat st; if (stat(path, &st) == 0) { - /* Path exists, check if it's a directory */ - if (S_ISDIR(st.st_mode)) { + /* Path exists, check if it's a directory using bit test */ + if ((st.st_mode & S_IFMT) == S_IFDIR) { return 1; } else { fprintf(stderr, "Error: %s exists but is not a directory\n", path);