]> sjero.net Git - wget/blobdiff - src/utils.c
[svn] In for loops with empty body, put the ";" on a separate line to silence
[wget] / src / utils.c
index 991aaf4befa4fd6735646d627016df736eb06384..29262c12e0a97ad91bd1f713e24c1e94ccb296b2 100644 (file)
@@ -68,11 +68,9 @@ so, delete this exception statement from your version.  */
 # include <termios.h>
 #endif
 
-/* Needed for run_with_timeout. */
+/* Needed for Unix version of run_with_timeout. */
 #include <signal.h>
-#ifdef HAVE_SETJMP_H
-# include <setjmp.h>
-#endif
+#include <setjmp.h>
 
 #ifndef HAVE_SIGSETJMP
 /* If sigsetjmp is a macro, configure won't pick it up. */
@@ -596,7 +594,7 @@ make_directory (const char *directory)
    file_merge("/foo/bar/", "baz") => "/foo/bar/baz"
    file_merge("foo", "bar")       => "bar"
 
-   In other words, it's a simpler and gentler version of uri_merge_1.  */
+   In other words, it's a simpler and gentler version of uri_merge.  */
 
 char *
 file_merge (const char *base, const char *file)
@@ -615,12 +613,14 @@ file_merge (const char *base, const char *file)
   return result;
 }
 \f
-/* Like fnmatch, but performs a lower-case comparison.  */
+/* Like fnmatch, but performs a case-insensitive match.  */
 
 int
 fnmatch_nocase (const char *pattern, const char *string, int flags)
 {
 #ifdef FNM_CASEFOLD
+  /* The FNM_CASEFOLD flag started as a GNU extension, but it is now
+     also present on *BSD platforms, and possibly elsewhere.  */
   return fnmatch (pattern, string, flags | FNM_CASEFOLD);
 #else
   /* Turn PATTERN and STRING to lower case and call fnmatch on them. */
@@ -670,9 +670,11 @@ bool
 frontcmp (const char *s1, const char *s2)
 {
   if (!opt.ignore_case)
-    for (; *s1 && *s2 && (*s1 == *s2); ++s1, ++s2);
+    for (; *s1 && *s2 && (*s1 == *s2); ++s1, ++s2)
+      ;
   else
-    for (; *s1 && *s2 && (TOLOWER (*s1) == TOLOWER (*s2)); ++s1, ++s2);
+    for (; *s1 && *s2 && (TOLOWER (*s1) == TOLOWER (*s2)); ++s1, ++s2)
+      ;
   return *s1 == '\0';
 }
 
@@ -1084,9 +1086,11 @@ merge_vecs (char **v1, char **v2)
       return v1;
     }
   /* Count v1.  */
-  for (i = 0; v1[i]; i++);
+  for (i = 0; v1[i]; i++)
+    ;
   /* Count v2.  */
-  for (j = 0; v2[j]; j++);
+  for (j = 0; v2[j]; j++)
+    ;
   /* Reallocate v1.  */
   v1 = xrealloc (v1, (i + j + 1) * sizeof (char **));
   memcpy (v1 + i, v2, (j + 1) * sizeof (char *));