summaryrefslogtreecommitdiff
path: root/package/wget/0001-Fix-include-define-clash-with-gnulib-s-unlink-module.patch
blob: 03c0a619d92fdde87b892d7543f83099b9a30f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 31ac36e170f4777655451fce10a2fa5b2b27ecd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Sat, 4 Feb 2017 18:02:54 +0100
Subject: [PATCH] Fix include/define clash with gnulib's unlink module

* src/options.h: Rename options.unlink to options.unlink_requested
* src/init.c: Replace options unlink member by unlink_requested
* src/http.c: Likewise
* src/ftp.c: Likewise
---
 src/ftp.c     | 2 +-
 src/http.c    | 2 +-
 src/init.c    | 2 +-
 src/options.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ftp.c b/src/ftp.c
index fe09817..2f2866c 100644
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1463,7 +1463,7 @@ Error in server response, closing control connection.\n"));
       else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
                || opt.output_document || count > 0)
         {
-          if (opt.unlink && file_exists_p (con->target))
+          if (opt.unlink_requested && file_exists_p (con->target))
             {
               if (unlink (con->target) < 0)
                 {
diff --git a/src/http.c b/src/http.c
index bd1f115..3c3c8b2 100644
--- a/src/http.c
+++ b/src/http.c
@@ -2486,7 +2486,7 @@ open_output_stream (struct http_stat *hs, int count, FILE **fp)
         }
       else if (ALLOW_CLOBBER || count > 0)
         {
-          if (opt.unlink && file_exists_p (hs->local_file))
+          if (opt.unlink_requested && file_exists_p (hs->local_file))
             {
               if (unlink (hs->local_file) < 0)
                 {
diff --git a/src/init.c b/src/init.c
index 271bc77..623ef9d 100644
--- a/src/init.c
+++ b/src/init.c
@@ -321,7 +321,7 @@ static const struct {
   { "timestamping",     &opt.timestamping,      cmd_boolean },
   { "tries",            &opt.ntry,              cmd_number_inf },
   { "trustservernames", &opt.trustservernames,  cmd_boolean },
-  { "unlink",           &opt.unlink,            cmd_boolean },
+  { "unlink",           &opt.unlink_requested,  cmd_boolean },
   { "useaskpass" ,      &opt.use_askpass,       cmd_use_askpass },
   { "useproxy",         &opt.use_proxy,         cmd_boolean },
   { "user",             &opt.user,              cmd_string },
diff --git a/src/options.h b/src/options.h
index d713acc..8a818ca 100644
--- a/src/options.h
+++ b/src/options.h
@@ -61,7 +61,7 @@ struct options
   bool add_hostdir;             /* Do we add hostname directory? */
   bool protocol_directories;    /* Whether to prepend "http"/"ftp" to dirs. */
   bool noclobber;               /* Disables clobbering of existing data. */
-  bool unlink;                  /* remove file before clobbering */
+  bool unlink_requested;        /* remove file before clobbering */
   char *dir_prefix;             /* The top of directory tree */
   char *lfilename;              /* Log filename */
   char *input_filename;         /* Input filename */
-- 
2.6.2