Use $LISTER.
Showing
1 changed file
with
1 additions
and
21 deletions
... | @@ -16,7 +16,6 @@ | ... | @@ -16,7 +16,6 @@ |
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
17 | 17 | ||
18 | #include "mail.h" | 18 | #include "mail.h" |
19 | #include <dirent.h> | ||
20 | 19 | ||
21 | /* | 20 | /* |
22 | * folders | 21 | * folders |
... | @@ -25,8 +24,6 @@ | ... | @@ -25,8 +24,6 @@ |
25 | int | 24 | int |
26 | mail_folders (int argc, char **argv) | 25 | mail_folders (int argc, char **argv) |
27 | { | 26 | { |
28 | DIR *dir; | ||
29 | struct dirent *dirent; | ||
30 | char *path; | 27 | char *path; |
31 | struct mail_env_entry *env = util_find_env ("folder"); | 28 | struct mail_env_entry *env = util_find_env ("folder"); |
32 | 29 | ||
... | @@ -37,24 +34,7 @@ mail_folders (int argc, char **argv) | ... | @@ -37,24 +34,7 @@ mail_folders (int argc, char **argv) |
37 | } | 34 | } |
38 | 35 | ||
39 | path = util_fullpath(env->value); | 36 | path = util_fullpath(env->value); |
40 | dir = opendir(path); | 37 | util_do_command("! %s %s", getenv("LISTER"), path); |
41 | if (!dir) | ||
42 | { | ||
43 | fprintf(ofile, "can't open directory `%s'\n", path); | ||
44 | free(path); | ||
45 | return 1; | ||
46 | } | ||
47 | |||
48 | |||
49 | while (dirent = readdir(dir)) | ||
50 | { | ||
51 | if (dirent->d_name[0] == '.') | ||
52 | continue; | ||
53 | fprintf(ofile, "%s\n", dirent->d_name); | ||
54 | } | ||
55 | |||
56 | closedir(dir); | ||
57 | |||
58 | free(path); | 38 | free(path); |
59 | 39 | ||
60 | return 0; | 40 | return 0; | ... | ... |
-
Please register or sign in to post a comment