Back to index

cell-binutils  2.17cvs20070401
Functions
filename_cmp.c File Reference
#include <ctype.h>
#include "filenames.h"

Go to the source code of this file.

Functions

int filename_cmp (const char *s1, const char *s2)

Function Documentation

int filename_cmp ( const char *  s1,
const char *  s2 
)

Definition at line 46 of file filename_cmp.c.

{
#ifndef HAVE_DOS_BASED_FILE_SYSTEM
  return strcmp(s1, s2);
#else
  for (;;)
    {
      int c1 = tolower (*s1);
      int c2 = tolower (*s2);

      /* On DOS-based file systems, the '/' and the '\' are equivalent.  */
      if (c1 == '/')
        c1 = '\\';
      if (c2 == '/')
        c2 = '\\';

      if (c1 != c2)
        return (c1 - c2);

      if (c1 == '\0')
        return 0;

      s1++;
      s2++;
    }
#endif
}

Here is the call graph for this function: