OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [libiberty/] [filename_cmp.c] - Diff between revs 21 and 161

Show entire file | Details | Blame | View Log

Rev 21 Rev 161
Line 48... Line 48...
*/
*/
 
 
int
int
filename_cmp (const char *s1, const char *s2)
filename_cmp (const char *s1, const char *s2)
{
{
#ifndef HAVE_DOS_BASED_FILE_SYSTEM
#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
 
    && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
  return strcmp(s1, s2);
  return strcmp(s1, s2);
#else
#else
  for (;;)
  for (;;)
    {
    {
      int c1 = TOLOWER (*s1);
      int c1 = *s1;
      int c2 = TOLOWER (*s2);
      int c2 = *s2;
 
 
 
#if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
 
      c1 = TOLOWER (c1);
 
      c2 = TOLOWER (c2);
 
#endif
 
 
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
      /* On DOS-based file systems, the '/' and the '\' are equivalent.  */
      /* On DOS-based file systems, the '/' and the '\' are equivalent.  */
      if (c1 == '/')
      if (c1 == '/')
        c1 = '\\';
        c1 = '\\';
      if (c2 == '/')
      if (c2 == '/')
        c2 = '\\';
        c2 = '\\';
 
#endif
 
 
      if (c1 != c2)
      if (c1 != c2)
        return (c1 - c2);
        return (c1 - c2);
 
 
      if (c1 == '\0')
      if (c1 == '\0')
Line 98... Line 106...
*/
*/
 
 
int
int
filename_ncmp (const char *s1, const char *s2, size_t n)
filename_ncmp (const char *s1, const char *s2, size_t n)
{
{
#ifndef HAVE_DOS_BASED_FILE_SYSTEM
#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
 
    && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
  return strncmp(s1, s2, n);
  return strncmp(s1, s2, n);
#else
#else
  if (!n)
  if (!n)
    return 0;
    return 0;
  for (; n > 0; --n)
  for (; n > 0; --n)
  {
  {
      int c1 = TOLOWER (*s1);
      int c1 = *s1;
      int c2 = TOLOWER (*s2);
      int c2 = *s2;
 
 
 
#if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
 
      c1 = TOLOWER (c1);
 
      c2 = TOLOWER (c2);
 
#endif
 
 
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
      /* On DOS-based file systems, the '/' and the '\' are equivalent.  */
      /* On DOS-based file systems, the '/' and the '\' are equivalent.  */
      if (c1 == '/')
      if (c1 == '/')
        c1 = '\\';
        c1 = '\\';
      if (c2 == '/')
      if (c2 == '/')
        c2 = '\\';
        c2 = '\\';
 
#endif
 
 
      if (c1 == '\0' || c1 != c2)
      if (c1 == '\0' || c1 != c2)
        return (c1 - c2);
        return (c1 - c2);
 
 
      s1++;
      s1++;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.