cline.c

changeset 23
778388400f7b
parent 22
4508da679ffb
child 24
3963e8800a12
child 25
802c5382f499
--- a/cline.c	Thu Oct 20 17:29:23 2011 +0200
+++ b/cline.c	Fri Oct 21 15:09:26 2011 +0200
@@ -153,17 +153,8 @@
     finder = strtok(NULL, ",");
   }
 
-  /* Open directory */
-  DIR *dir = opendir(directory);
-  if (dir == NULL) {
-    perror("Operation failed");
-    destroy_settings_t(settings);
-    return 1;
-  }
-
   /* Scan directory */
-  int lines = scanDirectory(dir, 0, directory, settings);
-  closedir(dir);
+  int lines = scanDirectory((scanner_t){directory, 0}, settings);
   destroy_settings_t(settings);
 
   /* Print double line and line count */

mercurial