Commit adc30a83 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

put the old #defined aliases for strcasecmp(), strncasecmp(),

strcasestr(), and strnlen() back with the #defined aliases for getline()
and getdelim(), as they make things simpler


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2401 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 8974efa2
Showing with 18 additions and 25 deletions
+18 -25
......@@ -483,12 +483,7 @@ size_t move_mbright(const char *buf, size_t pos)
/* This function is equivalent to strcasecmp(). */
int nstrcasecmp(const char *s1, const char *s2)
{
return
#ifdef HAVE_STRNCASECMP
strncasecmp(s1, s2, (size_t)-1);
#else
nstrncasecmp(s1, s2, (size_t)-1);
#endif
return strncasecmp(s1, s2, (size_t)-1);
}
#endif
......@@ -559,12 +554,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
return (towlower(ws1) - towlower(ws2));
} else
#endif
return
#ifdef HAVE_STRNCASECMP
strncasecmp(s1, s2, n);
#else
nstrncasecmp(s1, s2, n);
#endif
return strncasecmp(s1, s2, n);
}
#ifndef HAVE_STRCASESTR
......@@ -640,12 +630,7 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
return found_needle ? haystack : NULL;
} else
#endif
return
#ifdef HAVE_STRCASESTR
strcasestr(haystack, needle);
#else
nstrcasestr(haystack, needle);
#endif
return strcasestr(haystack, needle);
}
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
......@@ -802,12 +787,7 @@ size_t mbstrnlen(const char *s, size_t maxlen)
return n;
} else
#endif
return
#ifdef HAVE_STRNLEN
strnlen(s, maxlen);
#else
nstrnlen(s, maxlen);
#endif
return strnlen(s, maxlen);
}
#ifndef DISABLE_JUSTIFY
......
......@@ -100,7 +100,20 @@
#endif
#endif
/* If no getdelim() or getline(), use the versions we have. */
/* If no strcasecmp(), strncasecmp(), strcasestr(), strnlen(),
* getdelim(), or getline(), use the versions we have. */
#ifndef HAVE_STRCASECMP
#define strcasecmp nstrcasecmp
#endif
#ifndef HAVE_STRNCASECMP
#define strncasecmp nstrncasecmp
#endif
#ifndef HAVE_STRCASESTR
#define strcasestr nstrcasestr
#endif
#ifndef HAVE_STRNLEN
#define strnlen nstrnlen
#endif
#ifndef HAVE_GETDELIM
#define getdelim ngetdelim
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment