Fixed keyboard bug where keypresses were not being registered, working on libreadline
[tpg/acess2.git] / Usermode / Applications / ls_src / main.c
index 3ae63fd..297f5f9 100644 (file)
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
        }
 
        // Traverse Directory
-       while( (tmp = readdir(fd, buf)) )
+       while( (tmp = readdir(fd, buf)) > 0 )
        {
                // Error check
                if(tmp < 0) {
@@ -260,6 +260,9 @@ void DisplayFile(char *Filename)
                if(acl.perms & 1)       perms |= 0004;  // R
                if(acl.perms & 2)       perms |= 0002;  // W
                if(acl.perms & 8)       perms |= 0001;  // X
+               
+               // Close file
+               close(fd);
        }
        free(path);     // We're finished with it
        

UCC git Repository :: git.ucc.asn.au