Enable using symlinked directories with redbean -A flag

This commit is contained in:
Paul Kulchenko 2022-03-20 11:05:44 -07:00
parent b7f7c3b9d7
commit f4cd70a9ff

View file

@ -3526,7 +3526,8 @@ static void StorePath(const char *dirpath) {
DIR *d; DIR *d;
char *path; char *path;
struct dirent *e; struct dirent *e;
if (!isdirectory(dirpath)) return StoreFile(dirpath); if (!isdirectory(dirpath) && !endswith(dirpath, "/"))
return StoreFile(dirpath);
if (!(d = opendir(dirpath))) DIEF("Can't open %`'s", dirpath); if (!(d = opendir(dirpath))) DIEF("Can't open %`'s", dirpath);
while ((e = readdir(d))) { while ((e = readdir(d))) {
if (strcmp(e->d_name, ".") == 0) continue; if (strcmp(e->d_name, ".") == 0) continue;