]> git.sur5r.net Git - c128-kasse/commitdiff
Remove directory listing (just doesn't work, probably mixing cbm* with stdio again...
authorsECuRE <sECuRE@af93e077-1a23-4f1e-9cbe-9382a9d578f5>
Fri, 2 Nov 2007 22:07:14 +0000 (22:07 +0000)
committersECuRE <sECuRE@af93e077-1a23-4f1e-9cbe-9382a9d578f5>
Fri, 2 Nov 2007 22:07:14 +0000 (22:07 +0000)
git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@79 af93e077-1a23-4f1e-9cbe-9382a9d578f5

src/cat.c

index fedf00780a4e3c8d1fe1a8ae38d9380aaa3a1daf..ac3ae570e2631b0c61b84e1c52856fd4f875c9b9 100644 (file)
--- a/src/cat.c
+++ b/src/cat.c
@@ -2,7 +2,8 @@
 #include <conio.h>
 #include <string.h>
 #include <dirent.h>
-#include <cbm.h>
+#include <sys/types.h>
+#include <stdlib.h>
 
 #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");