- /* This is the bad way to do things :) */
- while (*list)
- list++;
- *list = Safe_strdup (str);
- if (!*list)
- {
- werror (E_OUT_OF_MEM, __FILE__, 0);
- exit (1);
- }
- *(++list) = NULL;
-}
-
-/** Given an array of string pointers returns a string containing all
- of the strings seperated by spaces. The returned string is on the
- heap. The join stops when a NULL pointer is hit.
-*/
-char *
-join(const char **pplist)
-{
- buffer[0] = 0;
-
- while (*pplist)
- {
- strncatz(buffer, *pplist, PATH_MAX);
- strncatz(buffer, " ", PATH_MAX);
- pplist++;
- }
-
- return buffer;
-}
-
-/** Given an array of string pointers, returns a string containing all
- of the strings seperated by spaces. The returned string is on the
- heap. n is the number of strings in the list.
-*/
-char *
-joinn(char **pplist, int n)
-{
- buffer[0] = 0;
-
- while (n--)
- {
- strncatz(buffer, *pplist, PATH_MAX);
- strncatz(buffer, " ", PATH_MAX);
- pplist++;
- }
-
- return buffer;
-}
-
-/** Returns TRUE if for the host the two path characters are
- equivalent.
-*/
-static bool
-pathCharsEquivalent(char c1, char c2)
-{
-#if NATIVE_WIN32
- /* win32 is case insensitive */
- if (tolower(c1) == tolower(c2))
- {
- return TRUE;
- }
- /* And / is equivalent to \ */
- else if (c1 == '/' && c2 == '\\')
- {
- return TRUE;
- }
- else if (c1 == '\\' && c2 == '/')
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-#else
- /* Assume a Unix host where they must match exactly. */
- return c1 == c2;
-#endif
-}
-
-static bool
-pathEquivalent(const char *p1, const char *p2)
-{
- while (*p1 != '\0' && *p2 != '\0')
- {
- if (pathCharsEquivalent (*p1, *p2) == FALSE)
- {
- break;
- }
- p1++;
- p2++;
- }
-
- return *p1 == *p2;
-}