mirror of git://git.sv.gnu.org/nano.git
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
This commit is contained in:
parent
8974efa27b
commit
adc30a839b
28
src/chars.c
28
src/chars.c
|
@ -483,12 +483,7 @@ size_t move_mbright(const char *buf, size_t pos)
|
||||||
/* This function is equivalent to strcasecmp(). */
|
/* This function is equivalent to strcasecmp(). */
|
||||||
int nstrcasecmp(const char *s1, const char *s2)
|
int nstrcasecmp(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
return
|
return strncasecmp(s1, s2, (size_t)-1);
|
||||||
#ifdef HAVE_STRNCASECMP
|
|
||||||
strncasecmp(s1, s2, (size_t)-1);
|
|
||||||
#else
|
|
||||||
nstrncasecmp(s1, s2, (size_t)-1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -559,12 +554,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||||
return (towlower(ws1) - towlower(ws2));
|
return (towlower(ws1) - towlower(ws2));
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
return
|
return strncasecmp(s1, s2, n);
|
||||||
#ifdef HAVE_STRNCASECMP
|
|
||||||
strncasecmp(s1, s2, n);
|
|
||||||
#else
|
|
||||||
nstrncasecmp(s1, s2, n);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_STRCASESTR
|
#ifndef HAVE_STRCASESTR
|
||||||
|
@ -640,12 +630,7 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
|
||||||
return found_needle ? haystack : NULL;
|
return found_needle ? haystack : NULL;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
return
|
return strcasestr(haystack, needle);
|
||||||
#ifdef HAVE_STRCASESTR
|
|
||||||
strcasestr(haystack, needle);
|
|
||||||
#else
|
|
||||||
nstrcasestr(haystack, needle);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
||||||
|
@ -802,12 +787,7 @@ size_t mbstrnlen(const char *s, size_t maxlen)
|
||||||
return n;
|
return n;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
return
|
return strnlen(s, maxlen);
|
||||||
#ifdef HAVE_STRNLEN
|
|
||||||
strnlen(s, maxlen);
|
|
||||||
#else
|
|
||||||
nstrnlen(s, maxlen);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifndef DISABLE_JUSTIFY
|
||||||
|
|
15
src/nano.h
15
src/nano.h
|
@ -100,7 +100,20 @@
|
||||||
#endif
|
#endif
|
||||||
#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
|
#ifndef HAVE_GETDELIM
|
||||||
#define getdelim ngetdelim
|
#define getdelim ngetdelim
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue