From 51a33680f443e99bf5343f398fd8c8a343b96eff Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 20 Oct 2025 15:50:52 -0700 Subject: [PATCH] Resolves error and style complaints by Gemini code review --- src/dir.c | 12 ++++-------- src/dsk.c | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/dir.c b/src/dir.c index ac4019a..e4d24fb 100644 --- a/src/dir.c +++ b/src/dir.c @@ -951,7 +951,7 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf) nextp->dirp = 1; quote_dname(namebuf, sizeof(namebuf)); strlcpy(nextp->lname, namebuf, sizeof(nextp->lname)); - strlcat(nextp->lname, LISPDIRCHAR, sizeof(nextp->lname)); + strlcat(nextp->lname, LISPDIRSTR, sizeof(nextp->lname)); nextp->lname_len = strlen(nextp->lname); } else { /* All other types than directory. */ @@ -1324,18 +1324,14 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf) nextp->dirp = 1; quote_dname(namebuf, sizeof(namebuf)); strlcpy(nextp->lname, namebuf, sizeof(nextp->lname)); - len = strlen(namebuf); - *(nextp->lname + len) = LISPDIRCHAR; - *(nextp->lname + len + 1) = '\0'; - nextp->lname_len = len + 1; + strlcat(nextp->lname, LISPDIRSTR, sizeof(nextp->lname)); + nextp->lname_len = strlen(nextp->lname); } else { /* All other types than directory. */ nextp->dirp = 0; quote_fname_ufs(namebuf, sizeof(namebuf)); - len = strlen(namebuf); strlcpy(nextp->lname, namebuf, sizeof(nextp->lname)); - *(nextp->lname + len) = '\0'; - nextp->lname_len = len; + nextp->lname_len = strlen(nextp->lname); } strlcpy(namebuf, dirp.name, sizeof(namebuf)); diff --git a/src/dsk.c b/src/dsk.c index 44104dd..56ac9c9 100644 --- a/src/dsk.c +++ b/src/dsk.c @@ -664,6 +664,7 @@ LispPTR COM_closefile(LispPTR *args) for (; rval == 0; S_TOUT(rval = _dos_findnext(&dirp))) { snprintf(file, sizeof(file), "%s\\%s", dir, dirp.name); } + alarm(0); } #ifndef DOS /* effectively NEVER, since we're in an ifdef DOS */ time[0].tv_sec = (long)sbuf.st_atime;