]> sjero.net Git - wget/commitdiff
[svn] Commit "minor fixes".
authorhniksic <devnull@localhost>
Mon, 6 Nov 2000 21:24:57 +0000 (13:24 -0800)
committerhniksic <devnull@localhost>
Mon, 6 Nov 2000 21:24:57 +0000 (13:24 -0800)
src/ChangeLog
src/config.h.in
src/http.c
src/log.c
src/url.c
src/utils.c
src/wget.h

index bf98dca82c4283deb0aebe597a2e6b44b3f53eb3..97be722e46f34507b63c4a18fc01faf1825926e6 100644 (file)
@@ -1,3 +1,20 @@
+2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * wget.h (DO_REALLOC_FROM_ALLOCA): Use braces to disambiguate
+       `if'.
+
+2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * url.c (construct): Insert unneeded initialization for the
+       compiler to shut up.
+
+       * config.h.in: Define _XOPEN_SOURCE to 500 to get the prototype
+       for strptime() (*duh*).  Define _SVID_SOURCE to get S_IFLNK which
+       otherwise gets lost when you define _XOPEN_SOURCE.
+
+       * utils.c (touch): Include the file name in the error message.
+       From Debian.
+
 2000-11-05  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * log.c (logvprintf): Use vsnprintf() in all cases.  If necessary,
index 0e8b2b4c7b33107b6cb19e1cb79582229e502f4c..709b979b8e893ba3b910dc3f1c18ce47c7381e4b 100644 (file)
@@ -194,4 +194,20 @@ char *alloca ();
 /* Define to 1 if ANSI function prototypes are usable.  */
 #undef PROTOTYPES
 
+/* Debian says:
+
+   to get prototype for strptime, we need this  (taken from lftp)
+   #ifdef __linux__
+   #define __USE_XOPEN 1
+   #endif
+
+   But I don't think that's right.  The __USE_XOPEN thing is an
+   internal glibc2 thing that gets defined in features.h.  From
+   reading that file carefully, I think we need something like this
+   incantation.  Without testing it, I can only hope that this won't
+   screw things up on other, non-glibc2 systems.  */
+
+#define _XOPEN_SOURCE 500
+#define _SVID_SOURCE
+
 #endif /* CONFIG_H */
index 5f373ab2f5f8dd42d439d96d8c5d4bb298b62e54..48c1bc5e94d578974c54a299719c4c6053922fd5 100644 (file)
@@ -960,7 +960,14 @@ File `%s' already there, will not retrieve.\n"), u->local);
           _wasn't_ specified last time, or the server contains files called
           *.orig, -N will be back to not operating correctly with -k. */
        {
-         /* Would a single s[n]printf() call be faster? */
+         /* Would a single s[n]printf() call be faster?  --dan
+
+            It wouldn't.  sprintf() is horribly slow.  At one point I
+            profiled Wget, and found that a measurable and
+            non-negligible amount of time was lost calling sprintf()
+            in url.c.  Replacing sprintf with inline calls to
+            strcpy() and long_to_string() made a difference.
+            --hniksic */
          strcpy(filename_plus_orig_suffix, u->local);
          strcpy(filename_plus_orig_suffix + filename_len, ".orig");
 
index d7bc72441addaed7098e443b2bcb11a9ab09b490..a71edf3b0db6b3adc5a57967a2c07ba8dee3976a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1,5 +1,5 @@
 /* Messages logging.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
 
 This file is part of Wget.
 
index 2b6573a900de51e9456406991d89147c42a2145d..5095c444e900ef312ac7c01618a6827bc7522ce6 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -1395,7 +1395,8 @@ construct (const char *url, const char *sub, int subsize, int no_proto)
             "/qux/xyzzy", our result should be
             "http://host/qux/xyzzy".  */
          int span;
-         const char *slash, *start_insert;
+         const char *slash;
+         const char *start_insert = NULL; /* for gcc to shut up. */
          const char *pos = url;
          int seen_slash_slash = 0;
          /* We're looking for the first slash, but want to ignore
index 633d7b616bba09089794477cac1e2a760c38c5f0..371afd6dbd4553bca76d548742d0bb0bde0873ff 100644 (file)
@@ -411,7 +411,7 @@ touch (const char *file, time_t tm)
 #endif
 
   if (utime (file, &times) == -1)
-    logprintf (LOG_NOTQUIET, "utime: %s\n", strerror (errno));
+    logprintf (LOG_NOTQUIET, "utime(%s): %s\n", file, strerror (errno));
 }
 
 /* Checks if FILE is a symbolic link, and removes it if it is.  Does
index fd97f097948e7da1025387dc4f747b84d29d0d5f..196f913c59c2669ce2da29f43aa2e3e98660655e 100644 (file)
@@ -173,25 +173,27 @@ char *xstrdup PARAMS ((const char *));
    DO_REALLOC.  */
 #define DO_REALLOC_FROM_ALLOCA(basevar, sizevar, needed_size, allocap, type) do        \
 {                                                                              \
-  /* Avoid side-effectualness.  */                             \
-  long do_realloc_needed_size = (needed_size);                 \
-  long do_realloc_newsize = 0;                                 \
-  while ((sizevar) < (do_realloc_needed_size)) {               \
-    do_realloc_newsize = 2*(sizevar);                          \
-    if (do_realloc_newsize < 16)                               \
-      do_realloc_newsize = 16;                                 \
-    (sizevar) = do_realloc_newsize;                            \
-  }                                                            \
-  if (do_realloc_newsize)                                      \
-    if (!allocap)                                              \
-      XREALLOC_ARRAY (basevar, type, do_realloc_newsize);      \
-    else                                                       \
-      {                                                                \
-       void *drfa_new_basevar = xmalloc (do_realloc_newsize);  \
-       memcpy (drfa_new_basevar, basevar, sizevar);            \
-       (basevar) = drfa_new_basevar;                           \
-       allocap = 0;                                            \
-      }                                                                \
+  /* Avoid side-effectualness.  */                                             \
+  long do_realloc_needed_size = (needed_size);                                 \
+  long do_realloc_newsize = 0;                                                 \
+  while ((sizevar) < (do_realloc_needed_size)) {                               \
+    do_realloc_newsize = 2*(sizevar);                                          \
+    if (do_realloc_newsize < 16)                                               \
+      do_realloc_newsize = 16;                                                 \
+    (sizevar) = do_realloc_newsize;                                            \
+  }                                                                            \
+  if (do_realloc_newsize)                                                      \
+    {                                                                          \
+      if (!allocap)                                                            \
+       XREALLOC_ARRAY (basevar, type, do_realloc_newsize);                     \
+      else                                                                     \
+       {                                                                       \
+         void *drfa_new_basevar = xmalloc (do_realloc_newsize);                \
+         memcpy (drfa_new_basevar, basevar, sizevar);                          \
+         (basevar) = drfa_new_basevar;                                         \
+         allocap = 0;                                                          \
+       }                                                                       \
+    }                                                                          \
 } while (0)
 
 /* Free FOO if it is non-NULL.  */