]> git.sur5r.net Git - c128-kasse/blobdiff - src/cat.c
make cat.c compile again
[c128-kasse] / src / cat.c
index fedf00780a4e3c8d1fe1a8ae38d9380aaa3a1daf..e0f866d433e7d18479075e57c57fcf6f509c3ea0 100644 (file)
--- a/src/cat.c
+++ b/src/cat.c
@@ -2,7 +2,7 @@
 #include <conio.h>
 #include <string.h>
 #include <dirent.h>
-#include <cbm.h>
+#include <stdlib.h>
 
 #include "general.h"
 
@@ -15,36 +15,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");