Fix compilation of mimeview.
* mimeview/mimeview.c (mimeview_fp): Restore the variable.
Showing
1 changed file
with
5 additions
and
5 deletions
... | @@ -69,7 +69,7 @@ static char *no_ask_types; /* List of MIME types for which no questions | ... | @@ -69,7 +69,7 @@ static char *no_ask_types; /* List of MIME types for which no questions |
69 | should be asked */ | 69 | should be asked */ |
70 | static int interactive = -1; | 70 | static int interactive = -1; |
71 | char *mimeview_file; /* Name of the file to view */ | 71 | char *mimeview_file; /* Name of the file to view */ |
72 | int mimeview_fd; /* Its descriptor */ | 72 | FILE *mimeview_fp; /* Its descriptor */ |
73 | 73 | ||
74 | static void | 74 | static void |
75 | set_debug_flags (mu_debug_t debug, const char *arg) | 75 | set_debug_flags (mu_debug_t debug, const char *arg) |
... | @@ -201,8 +201,8 @@ open_file (char *name) | ... | @@ -201,8 +201,8 @@ open_file (char *name) |
201 | } | 201 | } |
202 | 202 | ||
203 | mimeview_file = name; | 203 | mimeview_file = name; |
204 | mimeview_fd = open (name, O_RDONLY); | 204 | mimeview_fp = fopen (name, "r"); |
205 | if (mimeview_fd == -1) | 205 | if (mimeview_fp == NULL) |
206 | { | 206 | { |
207 | mu_error (_("Cannot open `%s': %s"), name, mu_strerror (errno)); | 207 | mu_error (_("Cannot open `%s': %s"), name, mu_strerror (errno)); |
208 | return -1; | 208 | return -1; |
... | @@ -213,7 +213,7 @@ open_file (char *name) | ... | @@ -213,7 +213,7 @@ open_file (char *name) |
213 | void | 213 | void |
214 | close_file () | 214 | close_file () |
215 | { | 215 | { |
216 | close (mimeview_fd); | 216 | fclose (mimeview_fp); |
217 | } | 217 | } |
218 | 218 | ||
219 | void | 219 | void |
... | @@ -258,7 +258,7 @@ display_file (const char *type) | ... | @@ -258,7 +258,7 @@ display_file (const char *type) |
258 | mu_error (_("cannot create header: %s"), mu_strerror (status)); | 258 | mu_error (_("cannot create header: %s"), mu_strerror (status)); |
259 | else | 259 | else |
260 | { | 260 | { |
261 | mu_stdio_stream_create (&stream, mimeview_fd, | 261 | mu_stdio_stream_create (&stream, fileno (mimeview_fp), |
262 | MU_STREAM_READ| | 262 | MU_STREAM_READ| |
263 | MU_STREAM_SEEK|MU_STREAM_NO_CLOSE); | 263 | MU_STREAM_SEEK|MU_STREAM_NO_CLOSE); |
264 | mu_stream_open (stream); | 264 | mu_stream_open (stream); | ... | ... |
-
Please register or sign in to post a comment