diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-13 10:35:44 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:52:47 +0100 |
commit | 1509effa50d0917578f8ab4dd412918cb11d6fcb (patch) | |
tree | f9a4f75eb01b57778a6be857c993c96e900c36f1 /ext/SDBM_File | |
parent | f1519f70705b2eee563b9ac4056d4eb39d383ea1 (diff) | |
download | perl-1509effa50d0917578f8ab4dd412918cb11d6fcb.tar.gz |
Rely on C89 strchr() and strrchr()
This needs a metaconfig change that defangs the standard unit for finding
strchr(), because that unit sees the uses of "index" and "rindex" (in files
like keywords.c and opcode.h) as indicators that it must be used instead.
Diffstat (limited to 'ext/SDBM_File')
-rw-r--r-- | ext/SDBM_File/dbe.c | 8 | ||||
-rw-r--r-- | ext/SDBM_File/dbu.c | 5 |
2 files changed, 2 insertions, 11 deletions
diff --git a/ext/SDBM_File/dbe.c b/ext/SDBM_File/dbe.c index 18ce54677e..d1e3bd5e77 100644 --- a/ext/SDBM_File/dbe.c +++ b/ext/SDBM_File/dbe.c @@ -1,4 +1,5 @@ #include <stdio.h> +#include <string.h> #ifndef VMS #include <sys/file.h> #include <ndbm.h> @@ -47,16 +48,11 @@ char *optarg; /* Global argument pointer. */ -#ifdef VMS -#define index strchr -#endif - char getopt(int argc, char **argv, char *optstring) { int c; char *place; - extern char *index(); static int optind = 0; static char *scan = NULL; @@ -78,7 +74,7 @@ getopt(int argc, char **argv, char *optstring) } c = *scan++; - place = index(optstring, c); + place = strchr(optstring, c); if (place == NULL || c == ':' || c == ';') { (void) fprintf(stderr, "%s: unknown option %c\n", argv[0], c); diff --git a/ext/SDBM_File/dbu.c b/ext/SDBM_File/dbu.c index 4631d40acd..ef1963d350 100644 --- a/ext/SDBM_File/dbu.c +++ b/ext/SDBM_File/dbu.c @@ -8,12 +8,7 @@ #endif #include <string.h> -#ifdef BSD42 -#define strchr index -#endif - extern int getopt(); -extern char *strchr(); extern void oops(); char *progname; |