Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
28133e93
Commit
28133e93
authored
8 years ago
by
Mike Frysinger
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
drop various str fallback functions
These are provided by gnulib now.
parent
ba8d71f4
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure.ac
+1
-1
configure.ac
src/chars.c
+0
-59
src/chars.c
src/nano.h
+0
-12
src/nano.h
src/proto.h
+0
-12
src/proto.h
with
1 addition
and
84 deletions
+1
-84
configure.ac
View file @
28133e93
...
...
@@ -473,7 +473,7 @@ int main(void)
dnl Checks for functions.
AC_CHECK_FUNCS(getdelim getline isblank
strcasecmp strcasestr strncasecmp strnlen
snprintf vsnprintf)
AC_CHECK_FUNCS(getdelim getline isblank snprintf vsnprintf)
if test "x$enable_utf8" != xno; then
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth)
...
...
This diff is collapsed.
Click to expand it.
src/chars.c
View file @
28133e93
...
...
@@ -450,36 +450,12 @@ size_t move_mbright(const char *buf, size_t pos)
return
pos
+
parse_mbchar
(
buf
+
pos
,
NULL
,
NULL
);
}
#ifndef HAVE_STRCASECMP
/* This function is equivalent to strcasecmp(). */
int
nstrcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
return
strncasecmp
(
s1
,
s2
,
HIGHEST_POSITIVE
);
}
#endif
/* This function is equivalent to strcasecmp() for multibyte strings. */
int
mbstrcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
return
mbstrncasecmp
(
s1
,
s2
,
HIGHEST_POSITIVE
);
}
#ifndef HAVE_STRNCASECMP
/* This function is equivalent to strncasecmp(). */
int
nstrncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
if
(
s1
==
s2
)
return
0
;
for
(;
*
s1
!=
'\0'
&&
*
s2
!=
'\0'
&&
n
>
0
;
s1
++
,
s2
++
,
n
--
)
{
if
(
tolower
(
*
s1
)
!=
tolower
(
*
s2
))
break
;
}
return
(
n
>
0
)
?
tolower
(
*
s1
)
-
tolower
(
*
s2
)
:
0
;
}
#endif
/* This function is equivalent to strncasecmp() for multibyte strings. */
int
mbstrncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
...
...
@@ -524,28 +500,6 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
return
strncasecmp
(
s1
,
s2
,
n
);
}
#ifndef HAVE_STRCASESTR
/* This function is equivalent to strcasestr(). */
char
*
nstrcasestr
(
const
char
*
haystack
,
const
char
*
needle
)
{
size_t
needle_len
;
if
(
*
needle
==
'\0'
)
return
(
char
*
)
haystack
;
needle_len
=
strlen
(
needle
);
while
(
*
haystack
!=
'\0'
)
{
if
(
strncasecmp
(
haystack
,
needle
,
needle_len
)
==
0
)
return
(
char
*
)
haystack
;
haystack
++
;
}
return
NULL
;
}
#endif
/* This function is equivalent to strcasestr() for multibyte strings. */
char
*
mbstrcasestr
(
const
char
*
haystack
,
const
char
*
needle
)
{
...
...
@@ -665,19 +619,6 @@ size_t mbstrlen(const char *s)
return
mbstrnlen
(
s
,
(
size_t
)
-
1
);
}
#ifndef HAVE_STRNLEN
/* This function is equivalent to strnlen(). */
size_t
nstrnlen
(
const
char
*
s
,
size_t
maxlen
)
{
size_t
n
=
0
;
for
(;
*
s
!=
'\0'
&&
maxlen
>
0
;
s
++
,
maxlen
--
,
n
++
)
;
return
n
;
}
#endif
/* This function is equivalent to strnlen() for multibyte strings. */
size_t
mbstrnlen
(
const
char
*
s
,
size_t
maxlen
)
{
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
28133e93
...
...
@@ -137,18 +137,6 @@
#ifndef HAVE_ISWBLANK
#define iswblank niswblank
#endif
#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
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
28133e93
...
...
@@ -217,17 +217,8 @@ char *make_mbchar(long chr, int *chr_mb_len);
int
parse_mbchar
(
const
char
*
buf
,
char
*
chr
,
size_t
*
col
);
size_t
move_mbleft
(
const
char
*
buf
,
size_t
pos
);
size_t
move_mbright
(
const
char
*
buf
,
size_t
pos
);
#ifndef HAVE_STRCASECMP
int
nstrcasecmp
(
const
char
*
s1
,
const
char
*
s2
);
#endif
int
mbstrcasecmp
(
const
char
*
s1
,
const
char
*
s2
);
#ifndef HAVE_STRNCASECMP
int
nstrncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
);
#endif
int
mbstrncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
);
#ifndef HAVE_STRCASESTR
char
*
nstrcasestr
(
const
char
*
haystack
,
const
char
*
needle
);
#endif
char
*
mbstrcasestr
(
const
char
*
haystack
,
const
char
*
needle
);
char
*
revstrstr
(
const
char
*
haystack
,
const
char
*
needle
,
const
char
*
pointer
);
...
...
@@ -236,9 +227,6 @@ char *revstrcasestr(const char *haystack, const char *needle, const char
char
*
mbrevstrcasestr
(
const
char
*
haystack
,
const
char
*
needle
,
const
char
*
rev_start
);
size_t
mbstrlen
(
const
char
*
s
);
#ifndef HAVE_STRNLEN
size_t
nstrnlen
(
const
char
*
s
,
size_t
maxlen
);
#endif
size_t
mbstrnlen
(
const
char
*
s
,
size_t
maxlen
);
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
char
*
mbstrchr
(
const
char
*
s
,
const
char
*
c
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help