# 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. */
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)
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. */
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';
}
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 *));