*** empty log message ***
Showing
1 changed file
with
2 additions
and
6 deletions
... | @@ -28,17 +28,12 @@ int | ... | @@ -28,17 +28,12 @@ int |
28 | mh_open (mailbox * mbox) | 28 | mh_open (mailbox * mbox) |
29 | { | 29 | { |
30 | int i; | 30 | int i; |
31 | char old_dir[PATH_MAX]; | ||
32 | struct dirent *entry; | 31 | struct dirent *entry; |
33 | mh_data *data; | 32 | mh_data *data; |
34 | 33 | ||
35 | if(mbox == NULL) | 34 | if(mbox == NULL) |
36 | return EINVAL; | 35 | return EINVAL; |
37 | 36 | ||
38 | if(getcwd (old_dir, PATH_MAX) == NULL) | ||
39 | old_dir[0] = '\0'; | ||
40 | chdir (mbox->name); | ||
41 | |||
42 | data = malloc (sizeof (mh_data)); | 37 | data = malloc (sizeof (mh_data)); |
43 | data->dir = opendir (mbox->name); | 38 | data->dir = opendir (mbox->name); |
44 | if(data->dir == NULL) | 39 | if(data->dir == NULL) |
... | @@ -49,6 +44,7 @@ mh_open (mailbox * mbox) | ... | @@ -49,6 +44,7 @@ mh_open (mailbox * mbox) |
49 | { | 44 | { |
50 | unsigned long seq_num; | 45 | unsigned long seq_num; |
51 | char *foo = NULL; | 46 | char *foo = NULL; |
47 | char fname[PATH_MAX]; | ||
52 | if (entry->d_name[0] == '.') | 48 | if (entry->d_name[0] == '.') |
53 | { | 49 | { |
54 | if (strcmp(entry->d_name, ".mh_sequences") == 0) | 50 | if (strcmp(entry->d_name, ".mh_sequences") == 0) |
... | @@ -80,7 +76,7 @@ mh_open (mailbox * mbox) | ... | @@ -80,7 +76,7 @@ mh_open (mailbox * mbox) |
80 | #endif | 76 | #endif |
81 | chdir(old_dir); | 77 | chdir(old_dir); |
82 | 78 | ||
83 | fprintf(stderr, "\n%d messages read\n", mbox->messages); | 79 | fprintf(stderr, "\r\n%d messages read\n", mbox->messages); |
84 | 80 | ||
85 | return 0; | 81 | return 0; |
86 | } | 82 | } | ... | ... |
-
Please register or sign in to post a comment