From 1e8bdea7363fd40920aee61ebfcee2bf5bd34947 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Thu, 30 Oct 2025 16:30:16 +0000 Subject: [PATCH 1/2] DIR: don't display invalid data with devices When doing `DIR NUL` findfirst will actually return success with an attribute indicating a device exists with that name. MS-DOS shows 'File not found' in this case, but Comcom (and also FreeCOM) can display invalid data, so let's correct that. Since the required constant _A_DEVICE isn't always present in `dos.h`, let's define it when necessary. Before: ~~~ C:\>dir nul Volume in drive c is IR DXXXXS C Directory of c:\ 2025-10-30 16:41 0 NUL 1 file(s) 0 bytes 0 dir(s) 48.7 GB free ~~~ With patch: ~~~ C:\>dir nul Volume in drive c is IR DXXXXS C Directory of c:\ File not found ~~~ --- src/command.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index 864d7a3..4142419 100644 --- a/src/command.c +++ b/src/command.c @@ -50,6 +50,9 @@ */ #include +#ifndef _A_DEVICE +#define _A_DEVICE 0x40u +#endif #include #include #include @@ -2693,7 +2696,8 @@ static void perform_dir(const char *arg) } if (first) { - if ((ffrc = findfirst_f(full_filespec, &ff, attrib, &ffhandle)) != 0) + if (((ffrc = findfirst_f(full_filespec, &ff, attrib, &ffhandle)) != 0) || + ff.ff_attrib == _A_DEVICE ) { puts("File not found"); // informational message -- not an error return; From e50fa43fce80bbdeee98715ad7b2ef75e8a7b86f Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Thu, 30 Oct 2025 17:27:10 +0000 Subject: [PATCH 2/2] CI: Update package database It seems the runner image has a strange package state, so we need to `apt update` before trying to install any packages. --- ci_prereq.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci_prereq.sh b/ci_prereq.sh index 1f8625b..25f82b8 100755 --- a/ci_prereq.sh +++ b/ci_prereq.sh @@ -1,5 +1,6 @@ #!/bin/sh +sudo apt update sudo apt install -y \ devscripts \ equivs