]> sjero.net Git - wget/blobdiff - src/url.c
[svn] Check for a recent gcc version before using the statement-as-expression
[wget] / src / url.c
index aa3b59788954d4199875e518614a905cb38c6748..3db7c2fb20e584ba16fbd6cfff88aa5ea57ec3d5 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -534,6 +534,12 @@ rewrite_shorthand_url (const char *url)
   if (p == url)
     return NULL;
 
+  /* If we're looking at "://", it means the URL uses a scheme we
+     don't support, which may include "https" when compiled without
+     SSL support.  Don't bogusly rewrite such URLs.  */
+  if (p[0] == ':' && p[1] == '/' && p[2] == '/')
+    return NULL;
+
   if (*p == ':')
     {
       const char *pp;
@@ -578,7 +584,7 @@ static void split_path PARAMS ((const char *, char **, char **));
    help because the check for literal accept is in the
    preprocessor.)  */
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && __GNUC__ >= 3
 
 #define strpbrk_or_eos(s, accept) ({           \
   char *SOE_p = strpbrk (s, accept);           \
@@ -587,7 +593,7 @@ static void split_path PARAMS ((const char *, char **, char **));
   SOE_p;                                       \
 })
 
-#else  /* not __GNUC__ */
+#else  /* not __GNUC__ or old gcc */
 
 static inline char *
 strpbrk_or_eos (const char *s, const char *accept)
@@ -597,7 +603,7 @@ strpbrk_or_eos (const char *s, const char *accept)
     p = strchr (s, '\0');
   return p;
 }
-#endif /* not __GNUC__ */
+#endif /* not __GNUC__ or old gcc */
 
 /* Turn STR into lowercase; return non-zero if a character was
    actually changed. */
@@ -1120,7 +1126,7 @@ url_free (struct url *url)
 }
 \f
 /* Create all the necessary directories for PATH (a file).  Calls
-   mkdirhier() internally.  */
+   make_directory internally.  */
 int
 mkalldirs (const char *path)
 {