From 05373e7cc18f5dd013dbf8349d359702b677d6d8 Mon Sep 17 00:00:00 2001 From: sECuRE Date: Fri, 2 Nov 2007 22:07:14 +0000 Subject: [PATCH] Remove directory listing (just doesn't work, probably mixing cbm* with stdio again), use "directory" in BASIC git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@79 af93e077-1a23-4f1e-9cbe-9382a9d578f5 --- src/cat.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/cat.c b/src/cat.c index fedf007..ac3ae57 100644 --- a/src/cat.c +++ b/src/cat.c @@ -2,7 +2,8 @@ #include #include #include -#include +#include +#include #include "general.h" @@ -15,36 +16,17 @@ int main() { unsigned char i; char buffer[8]; char readable[9]; - struct cbm_dirent *dirent; memset(readable, '\0', 9); while (1) { clrscr(); while (filename == NULL || *filename == '\0') { - printf("Please enter filename (q to exit, d for dirlist):\r\n"); + printf("Please enter filename (q to exit):\r\n"); filename = get_input(); } if (*filename == 'q') return 0; - else if (*filename == 'd') { - c = 0; - if (cbm_opendir((BYTE)8, (BYTE)8) != 0) { - cprintf("could not open directory\r\n"); - return 1; - } - while (cbm_readdir((BYTE)8, dirent) == 0) { - printf("file %d: %s\n", c, dirent->name); - get_input(); - } - cbm_closedir((BYTE)8); - - printf("Finished listing directory, press RETURN...\n"); - get_input(); - - filename = NULL; - continue; - } c = 0; if ((file = fopen(filename, "r")) == NULL) { printf("Could not open file\r\n"); -- 2.39.5