]> sjero.net Git - wget/commitdiff
Combine duplicated code.
authorSteven Schubiger <stsc@member.fsf.org>
Sat, 29 Sep 2012 09:40:01 +0000 (11:40 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 29 Sep 2012 09:40:01 +0000 (11:40 +0200)
src/ChangeLog
src/recur.c

index 7d3715b1a530fc9b1ec9966e51da0dc438101c26..862ce36d083676346d3ec7d24f94585f82718e9f 100644 (file)
@@ -1,3 +1,7 @@
+2012-09-28  Steven Schubiger  <stsc@member.fsf.org>
+
+       * src/recur.c (retrieve_tree): Combine duplicated code.
+
 2012-09-02  Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> (tiny change)
 
        * src/main.c (main): mark more strings for translation.
 2012-09-02  Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> (tiny change)
 
        * src/main.c (main): mark more strings for translation.
index bd017f0257852d5af2161e8fdc234d2a28bdc2aa..b6ba1d9558cb3b163eda8b33e3ac6f11046e553e 100644 (file)
@@ -1,6 +1,6 @@
 /* Handling of recursive HTTP retrieving.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 /* Handling of recursive HTTP retrieving.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+   2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation,
    Inc.
 
 This file is part of GNU Wget.
    Inc.
 
 This file is part of GNU Wget.
@@ -253,26 +253,23 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
          the second time.  */
       if (dl_url_file_map && hash_table_contains (dl_url_file_map, url))
         {
          the second time.  */
       if (dl_url_file_map && hash_table_contains (dl_url_file_map, url))
         {
+         bool is_css_bool;
+
           file = xstrdup (hash_table_get (dl_url_file_map, url));
 
           DEBUGP (("Already downloaded \"%s\", reusing it from \"%s\".\n",
                    url, file));
 
           file = xstrdup (hash_table_get (dl_url_file_map, url));
 
           DEBUGP (("Already downloaded \"%s\", reusing it from \"%s\".\n",
                    url, file));
 
-          /* this sucks, needs to be combined! */
-          if (html_allowed
-              && downloaded_html_set
-              && string_set_contains (downloaded_html_set, file))
-            {
-              descend = true;
-              is_css = false;
-            }
-          if (css_allowed
-              && downloaded_css_set
-              && string_set_contains (downloaded_css_set, file))
-            {
-              descend = true;
-              is_css = true;
-            }
+         if ((is_css_bool = (css_allowed
+                             && downloaded_css_set
+                             && string_set_contains (downloaded_css_set, file)))
+             || (html_allowed
+                 && downloaded_html_set
+                 && string_set_contains (downloaded_html_set, file)))
+           {
+             descend = true;
+             is_css = is_css_bool;
+           }
         }
       else
         {
         }
       else
         {