]>
Commit | Line | Data |
---|---|---|
2b54e22d | 1 | --- elinks-0.4pre17/src/protocol/file.c.orig Sun Sep 29 19:22:23 2002 |
2 | +++ elinks-0.4pre17/src/protocol/file.c Sun Sep 29 19:31:32 2002 | |
3 | @@ -353,14 +353,23 @@ | |
4 | ||
5 | h = open(name, O_RDONLY | O_NOCTTY); | |
6 | if (h == -1) { | |
7 | - saved_errno = errno; | |
8 | + unsigned char *new_name = init_str(); | |
9 | + unsigned int new_len = 0; | |
10 | + add_to_str(&new_name, &new_len, name); | |
11 | + add_to_str(&new_name, &new_len, ".gz"); | |
12 | + mem_free(name); | |
13 | + name = new_name; | |
14 | + h = open(name, O_RDONLY | O_NOCTTY); | |
15 | + if (h == -1) { | |
16 | + saved_errno = errno; | |
17 | ||
18 | - d = opendir(name); | |
19 | - if (d) goto dir; | |
20 | + d = opendir(name); | |
21 | + if (d) goto dir; | |
22 | ||
23 | - mem_free(name); | |
24 | - abort_conn_with_state(c, -saved_errno); | |
25 | - return; | |
26 | + mem_free(name); | |
27 | + abort_conn_with_state(c, -saved_errno); | |
28 | + return; | |
29 | + } | |
30 | } | |
31 | ||
32 | set_bin(h); |