summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-17 07:14:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-17 07:14:33 +0000
commit3e150a880447536a0af58c395e5a857635e985d3 (patch)
tree867c3504f60ee9bfd2fa5db3dd66d5b3a1649ecd /usr.bin
parent8e78a24e2e89c03ac53bd758a1781c925fe7ab71 (diff)
r?index -> strr?chr
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/compress/compress.c10
-rw-r--r--usr.bin/finger/finger.c7
-rw-r--r--usr.bin/finger/net.c8
-rw-r--r--usr.bin/fmt/fmt.c6
-rw-r--r--usr.bin/hexdump/display.c6
-rw-r--r--usr.bin/hexdump/parse.c12
-rw-r--r--usr.bin/locate/locate/fastfind.c6
-rw-r--r--usr.bin/locate/locate/util.c12
-rw-r--r--usr.bin/mail/aux.c22
-rw-r--r--usr.bin/mail/fio.c6
-rw-r--r--usr.bin/mail/lex.c6
-rw-r--r--usr.bin/mail/list.c6
-rw-r--r--usr.bin/mail/names.c6
-rw-r--r--usr.bin/more/more.c6
-rw-r--r--usr.bin/netstat/if.c6
-rw-r--r--usr.bin/netstat/inet.c10
-rw-r--r--usr.bin/netstat/iso.c6
-rw-r--r--usr.bin/netstat/route.c8
-rw-r--r--usr.bin/paste/paste.c8
-rw-r--r--usr.bin/patch/patch.c6
-rw-r--r--usr.bin/printf/printf.c12
-rw-r--r--usr.bin/quota/quota.c6
-rw-r--r--usr.bin/ranlib/misc.c6
-rw-r--r--usr.bin/rlogin/rlogin.c6
-rw-r--r--usr.bin/rusers/rusers.c6
-rw-r--r--usr.bin/sup/src/ci.c14
-rw-r--r--usr.bin/sup/src/expand.c4
-rw-r--r--usr.bin/sup/src/stree.c7
-rw-r--r--usr.bin/systat/disks.c7
-rw-r--r--usr.bin/systat/netcmds.c7
-rw-r--r--usr.bin/systat/netstat.c10
-rw-r--r--usr.bin/talk/get_names.c7
-rw-r--r--usr.bin/tftp/main.c20
-rw-r--r--usr.bin/tftp/tftp.c7
-rw-r--r--usr.bin/tip/aculib/courier.c8
-rw-r--r--usr.bin/tip/aculib/hayes.c8
-rw-r--r--usr.bin/tip/aculib/t3000.c8
-rw-r--r--usr.bin/tip/aculib/ventel.c10
-rw-r--r--usr.bin/tr/str.c6
-rw-r--r--usr.bin/tset/map.c6
-rw-r--r--usr.bin/tset/term.c8
-rw-r--r--usr.bin/tset/wrterm.c6
-rw-r--r--usr.bin/uudecode/uudecode.c6
-rw-r--r--usr.bin/vacation/vacation.c14
-rw-r--r--usr.bin/who/who.c6
-rw-r--r--usr.bin/window/lcmd1.c6
-rw-r--r--usr.bin/window/lcmd2.c6
-rw-r--r--usr.bin/window/main.c8
-rw-r--r--usr.bin/xinstall/xinstall.c6
-rw-r--r--usr.bin/yacc/test/ftp.tab.c7
50 files changed, 197 insertions, 204 deletions
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c
index 565532d286c..0f48dcbaf42 100644
--- a/usr.bin/compress/compress.c
+++ b/usr.bin/compress/compress.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compress.c,v 1.3 1997/01/15 23:42:22 millert Exp $ */
+/* $OpenBSD: compress.c,v 1.4 1997/01/17 07:12:29 millert Exp $ */
/* $NetBSD: compress.c,v 1.9 1995/03/26 09:44:38 glass Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
#else
-static char rcsid[] = "$OpenBSD: compress.c,v 1.3 1997/01/15 23:42:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: compress.c,v 1.4 1997/01/17 07:12:29 millert Exp $";
#endif
#endif /* not lint */
@@ -87,7 +87,7 @@ main(argc, argv)
int bits, cat, ch;
char *p, newname[MAXPATHLEN];
- if ((p = rindex(argv[0], '/')) == NULL)
+ if ((p = strrchr(argv[0], '/')) == NULL)
p = argv[0];
else
++p;
@@ -147,7 +147,7 @@ main(argc, argv)
compress(*argv, "/dev/stdout", bits);
break;
}
- if ((p = rindex(*argv, '.')) != NULL &&
+ if ((p = strrchr(*argv, '.')) != NULL &&
!strcmp(p, ".Z")) {
cwarnx("%s: name already has trailing .Z",
*argv);
@@ -166,7 +166,7 @@ main(argc, argv)
break;
case DECOMPRESS:
len = strlen(*argv);
- if ((p = rindex(*argv, '.')) == NULL ||
+ if ((p = strrchr(*argv, '.')) == NULL ||
strcmp(p, ".Z")) {
if (len > sizeof(newname) - 3) {
cwarnx("%s: name too long", *argv);
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 6a4350536f7..0cdaf6a1f42 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: finger.c,v 1.5 1997/01/15 23:42:28 millert Exp $ */
+/* $OpenBSD: finger.c,v 1.6 1997/01/17 07:12:31 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -48,7 +48,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)finger.c 5.22 (Berkeley) 6/29/90";*/
-static char rcsid[] = "$OpenBSD: finger.c,v 1.5 1997/01/15 23:42:28 millert Exp $";
+static char rcsid[] = "$OpenBSD: finger.c,v 1.6 1997/01/17 07:12:31 millert Exp $";
#endif /* not lint */
/*
@@ -188,7 +188,6 @@ userlist(argc, argv)
struct utmp user;
struct passwd *pw;
int dolocal, *used;
- char *index();
if (!(used = (int *)calloc((u_int)argc, (u_int)sizeof(int)))) {
(void)fprintf(stderr, "finger: out of space.\n");
@@ -197,7 +196,7 @@ userlist(argc, argv)
/* pull out all network requests */
for (i = 0, dolocal = 0, nettail = &nethead; i < argc; i++) {
- if (!index(argv[i], '@')) {
+ if (!strchr(argv[i], '@')) {
dolocal = 1;
continue;
}
diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c
index 4064dc86711..bba31a796cc 100644
--- a/usr.bin/finger/net.c
+++ b/usr.bin/finger/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.2 1996/06/26 05:33:18 deraadt Exp $ */
+/* $OpenBSD: net.c,v 1.3 1997/01/17 07:12:33 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)net.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: net.c,v 1.2 1996/06/26 05:33:18 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: net.c,v 1.3 1997/01/17 07:12:33 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -60,9 +60,9 @@ netfinger(name)
struct servent *sp;
struct sockaddr_in sin;
int s;
- char *alist[1], *host, *rindex();
+ char *alist[1], *host;
- if (!(host = rindex(name, '@')))
+ if (!(host = strrchr(name, '@')))
return;
*host++ = NULL;
if (inet_aton(host, &sin.sin_addr) == 0) {
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index 599dffc652f..86e5d453f6c 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmt.c,v 1.2 1996/06/26 05:33:21 deraadt Exp $ */
+/* $OpenBSD: fmt.c,v 1.3 1997/01/17 07:12:35 millert Exp $ */
/* $NetBSD: fmt.c,v 1.4 1995/09/01 01:29:41 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)fmt.c 8.1 (Berkeley) 7/20/93";
#endif
-static char rcsid[] = "$OpenBSD: fmt.c,v 1.2 1996/06/26 05:33:21 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fmt.c,v 1.3 1997/01/17 07:12:35 millert Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -288,7 +288,7 @@ split(line)
*/
if (*cp == '\0') {
*cp2++ = ' ';
- if (index(".:!", cp[-1]))
+ if (strchr(".:!", cp[-1]))
*cp2++ = ' ';
}
while (*cp == ' ')
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c
index b8b0bf996ac..b6a237cfe76 100644
--- a/usr.bin/hexdump/display.c
+++ b/usr.bin/hexdump/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.3 1996/06/26 05:34:17 deraadt Exp $ */
+/* $OpenBSD: display.c,v 1.4 1997/01/17 07:12:37 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)display.c 5.11 (Berkeley) 3/9/91";*/
-static char rcsid[] = "$OpenBSD: display.c,v 1.3 1996/06/26 05:34:17 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: display.c,v 1.4 1997/01/17 07:12:37 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -201,7 +201,7 @@ bpad(pr)
pr->flags = F_BPAD;
*pr->cchar = 's';
for (p1 = pr->fmt; *p1 != '%'; ++p1);
- for (p2 = ++p1; *p1 && index(spec, *p1); ++p1);
+ for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1);
while (*p2++ = *p1++);
}
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c
index 10281f47d65..18d11309caa 100644
--- a/usr.bin/hexdump/parse.c
+++ b/usr.bin/hexdump/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.2 1996/06/26 05:34:21 deraadt Exp $ */
+/* $OpenBSD: parse.c,v 1.3 1997/01/17 07:12:39 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)parse.c 5.6 (Berkeley) 3/9/91";*/
-static char rcsid[] = "$OpenBSD: parse.c,v 1.2 1996/06/26 05:34:21 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: parse.c,v 1.3 1997/01/17 07:12:39 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -61,7 +61,7 @@ addfile(name)
exit(1);
}
while (fgets(buf, sizeof(buf), fp)) {
- if (!(p = index(buf, '\n'))) {
+ if (!(p = strchr(buf, '\n'))) {
(void)fprintf(stderr, "hexdump: line too long.\n");
while ((ch = getchar()) != '\n' && ch != EOF);
continue;
@@ -171,7 +171,7 @@ size(fs)
* skip any special chars -- save precision in
* case it's a %s format.
*/
- while (index(spec + 1, *++fmt));
+ while (strchr(spec + 1, *++fmt));
if (*fmt == '.' && isdigit(*++fmt)) {
prec = atoi(fmt);
while (isdigit(*++fmt));
@@ -243,10 +243,10 @@ rewrite(fs)
if (fu->bcnt) {
sokay = USEBCNT;
/* skip to conversion character */
- for (++p1; index(spec, *p1); ++p1);
+ for (++p1; strchr(spec, *p1); ++p1);
} else {
/* skip any special chars, field width */
- while (index(spec + 1, *++p1));
+ while (strchr(spec + 1, *++p1));
if (*p1 == '.' && isdigit(*++p1)) {
sokay = USEPREC;
prec = atoi(p1);
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index a014f3ab551..f915bc9cc52 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fastfind.c,v 1.3 1996/10/20 00:52:54 michaels Exp $ */
+/* $OpenBSD: fastfind.c,v 1.4 1997/01/17 07:12:41 millert Exp $ */
/*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fastfind.c,v 1.3 1996/10/20 00:52:54 michaels Exp $
+ * $Id: fastfind.c,v 1.4 1997/01/17 07:12:41 millert Exp $
*/
#ifndef _LOCATE_STATISTIC_
@@ -172,7 +172,7 @@ fastfind
/* find optimal (last) char for searching */
for (p = pathpart; *p != '\0'; p++)
- if (index(LOCATE_REG, *p) != NULL)
+ if (strchr(LOCATE_REG, *p) != NULL)
break;
if (*p == '\0')
diff --git a/usr.bin/locate/locate/util.c b/usr.bin/locate/locate/util.c
index ce4c3ad90fc..95ff600c75f 100644
--- a/usr.bin/locate/locate/util.c
+++ b/usr.bin/locate/locate/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.2 1996/10/10 09:55:08 michaels Exp $
+/* $OpenBSD: util.c,v 1.3 1997/01/17 07:12:42 millert Exp $
*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
* Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: util.c,v 1.2 1996/10/10 09:55:08 michaels Exp $
+ * $Id: util.c,v 1.3 1997/01/17 07:12:42 millert Exp $
*/
@@ -162,7 +162,7 @@ patprep(name)
/* skip trailing metacharacters */
for (; p >= name; p--)
- if (index(LOCATE_REG, *p) == NULL)
+ if (strchr(LOCATE_REG, *p) == NULL)
break;
/*
@@ -172,7 +172,7 @@ patprep(name)
* |----< p
*/
if (p >= name &&
- (index(p, '[') != NULL || index(p, ']') != NULL)) {
+ (strchr(p, '[') != NULL || strchr(p, ']') != NULL)) {
for (p = name; *p != '\0'; p++)
if (*p == ']' || *p == '[')
break;
@@ -183,7 +183,7 @@ patprep(name)
* '*\*[a-z]'
* |-------< p
*/
- if (p >= name && index(LOCATE_REG, *p) != NULL)
+ if (p >= name && strchr(LOCATE_REG, *p) != NULL)
p = name - 1;
}
@@ -193,7 +193,7 @@ patprep(name)
else {
for (endmark = p; p >= name; p--)
- if (index(LOCATE_REG, *p) != NULL)
+ if (strchr(LOCATE_REG, *p) != NULL)
break;
for (++p;
(p <= endmark) && subp < (globfree + sizeof(globfree));)
diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c
index 66bf4e73a7e..287edc12897 100644
--- a/usr.bin/mail/aux.c
+++ b/usr.bin/mail/aux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aux.c,v 1.2 1996/06/11 12:53:32 deraadt Exp $ */
+/* $OpenBSD: aux.c,v 1.3 1997/01/17 07:12:44 millert Exp $ */
/* $NetBSD: aux.c,v 1.4 1996/06/08 19:48:10 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: aux.c,v 1.2 1996/06/11 12:53:32 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: aux.c,v 1.3 1997/01/17 07:12:44 millert Exp $";
#endif
#endif /* not lint */
@@ -414,7 +414,7 @@ nameof(mp, reptype)
cp = skin(name1(mp, reptype));
if (reptype != 0 || charcount(cp, '!') < 2)
return(cp);
- cp2 = rindex(cp, '!');
+ cp2 = strrchr(cp, '!');
cp2--;
while (cp2 > cp && *cp2 != '!')
cp2--;
@@ -466,8 +466,8 @@ skin(name)
if (name == NOSTR)
return(NOSTR);
- if (index(name, '(') == NOSTR && index(name, '<') == NOSTR
- && index(name, ' ') == NOSTR)
+ if (strchr(name, '(') == NOSTR && strchr(name, '<') == NOSTR
+ && strchr(name, ' ') == NOSTR)
return(name);
gotlt = 0;
lastsp = 0;
@@ -592,24 +592,24 @@ newname:
*cp2 = '\0';
if (readline(ibuf, linebuf, LINESIZE) < 0)
return(savestr(namebuf));
- if ((cp = index(linebuf, 'F')) == NULL)
+ if ((cp = strchr(linebuf, 'F')) == NULL)
return(savestr(namebuf));
if (strncmp(cp, "From", 4) != 0)
return(savestr(namebuf));
- while ((cp = index(cp, 'r')) != NULL) {
+ while ((cp = strchr(cp, 'r')) != NULL) {
if (strncmp(cp, "remote", 6) == 0) {
- if ((cp = index(cp, 'f')) == NULL)
+ if ((cp = strchr(cp, 'f')) == NULL)
break;
if (strncmp(cp, "from", 4) != 0)
break;
- if ((cp = index(cp, ' ')) == NULL)
+ if ((cp = strchr(cp, ' ')) == NULL)
break;
cp++;
if (first) {
strcpy(namebuf, cp);
first = 0;
} else
- strcpy(rindex(namebuf, '!')+1, cp);
+ strcpy(strrchr(namebuf, '!')+1, cp);
strcat(namebuf, "!");
goto newname;
}
@@ -644,7 +644,7 @@ anyof(s1, s2)
{
while (*s1)
- if (index(s2, *s1++))
+ if (strchr(s2, *s1++))
return 1;
return 0;
}
diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c
index 1813bdc09ff..80e0bdbe7d5 100644
--- a/usr.bin/mail/fio.c
+++ b/usr.bin/mail/fio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fio.c,v 1.2 1996/06/11 12:53:39 deraadt Exp $ */
+/* $OpenBSD: fio.c,v 1.3 1997/01/17 07:12:46 millert Exp $ */
/* $NetBSD: fio.c,v 1.5 1996/06/08 19:48:22 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)fio.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: fio.c,v 1.2 1996/06/11 12:53:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fio.c,v 1.3 1997/01/17 07:12:46 millert Exp $";
#endif
#endif /* not lint */
@@ -398,7 +398,7 @@ expand(name)
for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
;
cp[1] = '\0';
- if (index(xname, ' ') && stat(xname, &sbuf) < 0) {
+ if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) {
fprintf(stderr, "\"%s\": Ambiguous.\n", name);
return NOSTR;
}
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c
index 36dccc59a13..d1be3133e98 100644
--- a/usr.bin/mail/lex.c
+++ b/usr.bin/mail/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.3 1996/06/11 12:53:42 deraadt Exp $ */
+/* $OpenBSD: lex.c,v 1.4 1997/01/17 07:12:47 millert Exp $ */
/* $NetBSD: lex.c,v 1.7 1996/06/08 19:48:28 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lex.c,v 1.3 1996/06/11 12:53:42 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: lex.c,v 1.4 1997/01/17 07:12:47 millert Exp $";
#endif
#endif /* not lint */
@@ -282,7 +282,7 @@ execute(linebuf, contxt)
return(0);
}
cp2 = word;
- while (*cp && index(" \t0123456789$^.:/-+*'\"", *cp) == NOSTR)
+ while (*cp && strchr(" \t0123456789$^.:/-+*'\"", *cp) == NOSTR)
*cp2++ = *cp++;
*cp2 = '\0';
diff --git a/usr.bin/mail/list.c b/usr.bin/mail/list.c
index dea57d67666..ddae30f7b84 100644
--- a/usr.bin/mail/list.c
+++ b/usr.bin/mail/list.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: list.c,v 1.2 1996/06/11 12:53:43 deraadt Exp $ */
+/* $OpenBSD: list.c,v 1.3 1997/01/17 07:12:49 millert Exp $ */
/* $NetBSD: list.c,v 1.4 1996/06/08 19:48:30 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)list.c 8.2 (Berkeley) 4/19/94";
#else
-static char rcsid[] = "$OpenBSD: list.c,v 1.2 1996/06/11 12:53:43 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: list.c,v 1.3 1997/01/17 07:12:49 millert Exp $";
#endif
#endif /* not lint */
@@ -705,7 +705,7 @@ matchsubj(str, mesg)
* Now look, ignoring case, for the word in the string.
*/
- if (value("searchheaders") && (cp = index(str, ':'))) {
+ if (value("searchheaders") && (cp = strchr(str, ':'))) {
*cp++ = '\0';
cp2 = hfield(str, mp);
cp[-1] = ':';
diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c
index 7a8a8153715..5378dfd6698 100644
--- a/usr.bin/mail/names.c
+++ b/usr.bin/mail/names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: names.c,v 1.2 1996/06/11 12:53:45 deraadt Exp $ */
+/* $OpenBSD: names.c,v 1.3 1997/01/17 07:12:50 millert Exp $ */
/* $NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)names.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: names.c,v 1.2 1996/06/11 12:53:45 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: names.c,v 1.3 1997/01/17 07:12:50 millert Exp $";
#endif
#endif /* not lint */
@@ -204,7 +204,7 @@ yankword(ap, wbuf)
for (cp2 = wbuf; *cp && (*cp2++ = *cp++) != '>';)
;
else
- for (cp2 = wbuf; *cp && !index(" \t,(", *cp); *cp2++ = *cp++)
+ for (cp2 = wbuf; *cp && !strchr(" \t,(", *cp); *cp2++ = *cp++)
;
*cp2 = '\0';
return cp;
diff --git a/usr.bin/more/more.c b/usr.bin/more/more.c
index 7c14add7f6a..a53ee5563d8 100644
--- a/usr.bin/more/more.c
+++ b/usr.bin/more/more.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: more.c,v 1.6 1996/10/14 15:23:54 etheisen Exp $ */
+/* $OpenBSD: more.c,v 1.7 1997/01/17 07:12:53 millert Exp $ */
/*-
* Copyright (c) 1980 The Regents of the University of California.
* All rights reserved.
@@ -201,9 +201,7 @@ char *argv[];
if (nfiles > 1)
prnames++;
if (!no_intty && nfiles == 0) {
- char *rindex();
-
- p = rindex(argv[0], '/');
+ p = strrchr(argv[0], '/');
fputs("usage: ",stderr);
fputs(p ? p + 1 : argv[0],stderr);
fputs(" [-dfln] [+linenum | +/pattern] name1 name2 ...\n",stderr);
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index d827d215c27..12d1be9dee4 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.9 1996/08/16 09:38:56 mickey Exp $ */
+/* $OpenBSD: if.c,v 1.10 1997/01/17 07:12:55 millert Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
-static char *rcsid = "$OpenBSD: if.c,v 1.9 1996/08/16 09:38:56 mickey Exp $";
+static char *rcsid = "$OpenBSD: if.c,v 1.10 1997/01/17 07:12:55 millert Exp $";
#endif
#endif /* not lint */
@@ -136,7 +136,7 @@ intpr(interval, ifnetaddr)
ifnetaddr = (u_long)ifnet.if_list.tqe_next;
if (interface != 0 && strcmp(name, interface) != 0)
continue;
- cp = index(name, '\0');
+ cp = strchr(name, '\0');
if ((ifnet.if_flags & IFF_UP) == 0)
*cp++ = '*';
*cp = '\0';
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index bc33664379a..7b5873666ec 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.c,v 1.3 1996/06/26 05:37:21 deraadt Exp $ */
+/* $OpenBSD: inet.c,v 1.4 1997/01/17 07:12:57 millert Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-static char *rcsid = "$OpenBSD: inet.c,v 1.3 1996/06/26 05:37:21 deraadt Exp $";
+static char *rcsid = "$OpenBSD: inet.c,v 1.4 1997/01/17 07:12:57 millert Exp $";
#endif
#endif /* not lint */
@@ -434,7 +434,7 @@ inetprint(in, port, proto)
int width;
sprintf(line, "%.*s.", (Aflag && !nflag) ? 12 : 16, inetname(in));
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
if (!nflag && port)
sp = getservbyport((int)port, proto);
if (sp || port == 0)
@@ -464,7 +464,7 @@ inetname(inp)
if (first && !nflag) {
first = 0;
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
- (cp = index(domain, '.')))
+ (cp = strchr(domain, '.')))
(void) strcpy(domain, cp + 1);
else
domain[0] = 0;
@@ -482,7 +482,7 @@ inetname(inp)
if (cp == 0) {
hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET);
if (hp) {
- if ((cp = index(hp->h_name, '.')) &&
+ if ((cp = strchr(hp->h_name, '.')) &&
!strcmp(cp + 1, domain))
*cp = 0;
cp = hp->h_name;
diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c
index 7e0a76bd907..6f5d6af88ef 100644
--- a/usr.bin/netstat/iso.c
+++ b/usr.bin/netstat/iso.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iso.c,v 1.2 1996/06/26 05:37:21 deraadt Exp $ */
+/* $OpenBSD: iso.c,v 1.3 1997/01/17 07:12:58 millert Exp $ */
/* $NetBSD: iso.c,v 1.12 1995/10/03 21:42:38 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)iso.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: iso.c,v 1.2 1996/06/26 05:37:21 deraadt Exp $";
+static char *rcsid = "$OpenBSD: iso.c,v 1.3 1997/01/17 07:12:58 millert Exp $";
#endif
#endif /* not lint */
@@ -419,7 +419,7 @@ isonetprint(iso, sufx, sufxlen, islocal)
int Alen = Aflag?18:22;
line = isonetname(iso);
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
ihe = (struct iso_hostent *)0;
if( islocal )
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 387b4e9ffce..e0645de89fc 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.6 1996/10/25 10:50:52 deraadt Exp $ */
+/* $OpenBSD: route.c,v 1.7 1997/01/17 07:13:00 millert Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: route.c,v 1.6 1996/10/25 10:50:52 deraadt Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.7 1997/01/17 07:13:00 millert Exp $";
#endif
#endif /* not lint */
@@ -497,7 +497,7 @@ routename(in)
if (first) {
first = 0;
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
- (cp = index(domain, '.')))
+ (cp = strchr(domain, '.')))
(void) strcpy(domain, cp + 1);
else
domain[0] = 0;
@@ -507,7 +507,7 @@ routename(in)
hp = gethostbyaddr((char *)&in, sizeof (struct in_addr),
AF_INET);
if (hp) {
- if ((cp = index(hp->h_name, '.')) &&
+ if ((cp = strchr(hp->h_name, '.')) &&
!strcmp(cp + 1, domain))
*cp = 0;
cp = hp->h_name;
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index 514227f4d4a..a63f6159c35 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.3 1997/01/15 23:43:02 millert Exp $ */
+/* $OpenBSD: paste.c,v 1.4 1997/01/17 07:13:02 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -44,7 +44,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)paste.c 5.7 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$OpenBSD: paste.c,v 1.3 1997/01/15 23:43:02 millert Exp $";
+static char rcsid[] = "$OpenBSD: paste.c,v 1.4 1997/01/17 07:13:02 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -149,7 +149,7 @@ parallel(argv)
putchar(ch);
continue;
}
- if (!(p = index(buf, '\n'))) {
+ if (!(p = strchr(buf, '\n'))) {
(void)fprintf(stderr,
"paste: %s: input line too long.\n",
lp->name);
@@ -192,7 +192,7 @@ sequential(argv)
}
if (fgets(buf, sizeof(buf), fp)) {
for (cnt = 0, dp = delim;;) {
- if (!(p = index(buf, '\n'))) {
+ if (!(p = strchr(buf, '\n'))) {
(void)fprintf(stderr,
"paste: %s: input line too long.\n",
*argv);
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index be4b7f4ac61..2c438db0789 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.8 1996/09/24 04:19:28 millert Exp $ */
+/* $OpenBSD: patch.c,v 1.9 1997/01/17 07:13:04 millert Exp $ */
/* patch - a program to apply diffs to original files
*
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: patch.c,v 1.8 1996/09/24 04:19:28 millert Exp $";
+static char rcsid[] = "$OpenBSD: patch.c,v 1.9 1997/01/17 07:13:04 millert Exp $";
#endif /* not lint */
#include "INTERN.h"
@@ -301,7 +301,7 @@ char **argv;
Strcpy(rejname, outname);
#ifndef FLEXFILENAMES
{
- char *s = rindex(rejname,'/');
+ char *s = strrchr(rejname,'/');
if (!s)
s = rejname;
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 027397207a9..006ceba0518 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.2 1996/06/26 05:37:59 deraadt Exp $ */
+/* $OpenBSD: printf.c,v 1.3 1997/01/17 07:13:06 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -43,7 +43,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)printf.c 5.9 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: printf.c,v 1.2 1996/06/26 05:37:59 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: printf.c,v 1.3 1997/01/17 07:13:06 millert Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -190,16 +190,16 @@ main(argc, argv)
}
/* skip to field width */
- for (; index(SKIP1, *fmt); ++fmt) ;
+ for (; strchr(SKIP1, *fmt); ++fmt) ;
fieldwidth = *fmt == '*' ? getint() : 0;
/* skip to possible '.', get following precision */
- for (; index(SKIP2, *fmt); ++fmt) ;
+ for (; strchr(SKIP2, *fmt); ++fmt) ;
if (*fmt == '.')
++fmt;
precision = *fmt == '*' ? getint() : 0;
- for (; index(SKIP2, *fmt); ++fmt) ;
+ for (; strchr(SKIP2, *fmt); ++fmt) ;
if (!*fmt) {
warnx ("missing format character");
return(1);
@@ -446,7 +446,7 @@ getint()
if (!*gargv)
return(0);
- if (index(number, **gargv))
+ if (strchr(number, **gargv))
return(atoi(*gargv++));
return 0;
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 666c78454e7..617f7f14f7f 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quota.c,v 1.8 1996/10/28 04:08:21 millert Exp $ */
+/* $OpenBSD: quota.c,v 1.9 1997/01/17 07:13:08 millert Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -44,7 +44,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quota.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: quota.c,v 1.8 1996/10/28 04:08:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: quota.c,v 1.9 1997/01/17 07:13:08 millert Exp $";
#endif /* not lint */
/*
@@ -507,7 +507,7 @@ ufshasquota(fs, type, qfnamep)
}
strncpy(buf, fs->fs_mntops, sizeof buf);
for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
- if (cp = index(opt, '='))
+ if (cp = strchr(opt, '='))
*cp++ = '\0';
if (type == USRQUOTA && strcmp(opt, usrname) == 0)
break;
diff --git a/usr.bin/ranlib/misc.c b/usr.bin/ranlib/misc.c
index c688af4aaec..01370e93a59 100644
--- a/usr.bin/ranlib/misc.c
+++ b/usr.bin/ranlib/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.2 1996/06/26 05:38:04 deraadt Exp $ */
+/* $OpenBSD: misc.c,v 1.3 1997/01/17 07:13:11 millert Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)misc.c 5.2 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: misc.c,v 1.2 1996/06/26 05:38:04 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: misc.c,v 1.3 1997/01/17 07:13:11 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -101,7 +101,7 @@ rname(path)
{
register char *ind;
- return((ind = rindex(path, '/')) ? ind + 1 : path);
+ return((ind = strrchr(path, '/')) ? ind + 1 : path);
}
badfmt()
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index 51e72d9d2fb..b02d50b3de8 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlogin.c,v 1.11 1997/01/15 23:43:06 millert Exp $ */
+/* $OpenBSD: rlogin.c,v 1.12 1997/01/17 07:13:13 millert Exp $ */
/* $NetBSD: rlogin.c,v 1.8 1995/10/05 09:07:22 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: rlogin.c,v 1.11 1997/01/15 23:43:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: rlogin.c,v 1.12 1997/01/17 07:13:13 millert Exp $";
#endif
#endif /* not lint */
@@ -164,7 +164,7 @@ main(argc, argv)
one = 1;
host = user = NULL;
- if (p = rindex(argv[0], '/'))
+ if (p = strrchr(argv[0], '/'))
++p;
else
p = argv[0];
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c
index dd34d13ce94..3a2d9ca8a51 100644
--- a/usr.bin/rusers/rusers.c
+++ b/usr.bin/rusers/rusers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers.c,v 1.4 1996/08/16 22:24:18 deraadt Exp $ */
+/* $OpenBSD: rusers.c,v 1.5 1997/01/17 07:13:15 millert Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rusers.c,v 1.4 1996/08/16 22:24:18 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rusers.c,v 1.5 1997/01/17 07:13:15 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -237,7 +237,7 @@ main(int argc, char *argv[])
int ch;
extern int optind;
- if (!(argv0 = rindex(argv[0], '/')))
+ if (!(argv0 = strrchr(argv[0], '/')))
argv0 = argv[0];
else
argv0++;
diff --git a/usr.bin/sup/src/ci.c b/usr.bin/sup/src/ci.c
index 772f36dc384..ed5acd2db75 100644
--- a/usr.bin/sup/src/ci.c
+++ b/usr.bin/sup/src/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.2 1996/06/26 05:39:38 deraadt Exp $ */
+/* $OpenBSD: ci.c,v 1.3 1997/01/17 07:13:18 millert Exp $ */
/*
* Copyright (c) 1991 Carnegie Mellon University
@@ -145,7 +145,7 @@
#include <ci.h>
#include <del.h>
-char *index(),*getenv(),*rindex();
+char *getenv();
extern char _argbreak;
long atol();
double atof();
@@ -295,7 +295,7 @@ char *cmdfpath; /* search list for command files */
/* check for redirection of output */
if (!ciexit) {
- outname = rindex (p,'>');
+ outname = strrchr (p,'>');
if (outname) {
if (outname == p || *(outname+1) == 0
|| ((*(outname-1) != ' ') && (*(outname-1) != '\t'))) {
@@ -383,7 +383,7 @@ char *cmdfpath; /* search list for command files */
break;
default: /* list cmds, etc. */
- equals = index (cmd,'=');
+ equals = strchr (cmd,'=');
if (equals == cmd) cmd++;
if (equals) {
@@ -397,7 +397,7 @@ char *cmdfpath; /* search list for command files */
*equals = '='; /* if user doesn't want extra =, kill */
equals = 0;
}
- star = index (cmd,'*');
+ star = strchr (cmd,'*');
if (star) *star = 0;
if (star && equals) { /* list vars */
printf ("\n");
@@ -555,7 +555,7 @@ char *topic,*helppath;
}
}
else { /* chop at * */
- star = index (topic,'*');
+ star = strchr (topic,'*');
if (star) *star = 0;
}
@@ -787,7 +787,7 @@ char *arg;
eptr->ci_ufloat = atof (arg);
break;
case ci_tbool:
- eptr->ci_ubool = (index("yYtT",*arg) != 0);
+ eptr->ci_ubool = (strchr("yYtT",*arg) != 0);
break;
case ci_tcint:
*(eptr->ci_ucint.ci_ival) =
diff --git a/usr.bin/sup/src/expand.c b/usr.bin/sup/src/expand.c
index 9716d914a76..a379567c395 100644
--- a/usr.bin/sup/src/expand.c
+++ b/usr.bin/sup/src/expand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expand.c,v 1.2 1996/06/26 05:39:40 deraadt Exp $ */
+/* $OpenBSD: expand.c,v 1.3 1997/01/17 07:13:20 millert Exp $ */
/*
* Copyright (c) 1991 Carnegie Mellon University
@@ -134,7 +134,7 @@ static void glob(as)
while (*pathp) pathp++;
}
}
- while (*cs == 0 || index(globchars, *cs) == 0) {
+ while (*cs == 0 || strchr(globchars, *cs) == 0) {
if (*cs == 0) {
if (lstat(path, &stb) >= 0) addone(path, "");
goto endit;
diff --git a/usr.bin/sup/src/stree.c b/usr.bin/sup/src/stree.c
index eadb38f3582..0e2287d9e79 100644
--- a/usr.bin/sup/src/stree.c
+++ b/usr.bin/sup/src/stree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stree.c,v 1.2 1996/06/26 05:39:48 deraadt Exp $ */
+/* $OpenBSD: stree.c,v 1.3 1997/01/17 07:13:21 millert Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -30,6 +30,9 @@
**********************************************************************
* HISTORY
* $Log: stree.c,v $
+ * Revision 1.3 1997/01/17 07:13:21 millert
+ * r?index -> strr?chr
+ *
* Revision 1.2 1996/06/26 05:39:48 deraadt
* rcsid
*
@@ -277,7 +280,7 @@ char *p;
return (x);
(void) strncpy(buf, p, sizeof(buf)-1);
buf[MAXPATHLEN] = '\0';
- while ((p = rindex(buf, '/')) != NULL) {
+ while ((p = strrchr(buf, '/')) != NULL) {
while (p >= buf && *(p-1) == '/')
p--;
if (p == buf)
diff --git a/usr.bin/systat/disks.c b/usr.bin/systat/disks.c
index c5e564debc5..ca43095f3bc 100644
--- a/usr.bin/systat/disks.c
+++ b/usr.bin/systat/disks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disks.c,v 1.5 1996/06/26 05:40:05 deraadt Exp $ */
+/* $OpenBSD: disks.c,v 1.6 1997/01/17 07:13:23 millert Exp $ */
/* $NetBSD: disks.c,v 1.4 1996/05/10 23:16:33 thorpej Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)disks.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: disks.c,v 1.5 1996/06/26 05:40:05 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: disks.c,v 1.6 1997/01/17 07:13:23 millert Exp $";
#endif /* not lint */
#include "systat.h"
@@ -76,9 +76,8 @@ dkselect(args, truefalse, selections)
{
register char *cp;
register int i;
- char *index();
- cp = index(args, '\n');
+ cp = strchr(args, '\n');
if (cp)
*cp = '\0';
for (;;) {
diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c
index e362dd508a9..32ad7266690 100644
--- a/usr.bin/systat/netcmds.c
+++ b/usr.bin/systat/netcmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcmds.c,v 1.2 1996/06/26 05:40:09 deraadt Exp $ */
+/* $OpenBSD: netcmds.c,v 1.3 1997/01/17 07:13:25 millert Exp $ */
/* $NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: netcmds.c,v 1.2 1996/06/26 05:40:09 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: netcmds.c,v 1.3 1997/01/17 07:13:25 millert Exp $";
#endif /* not lint */
/*
@@ -132,9 +132,8 @@ changeitems(args, onoff)
struct servent *sp;
struct hostent *hp;
struct in_addr in;
- char *index();
- cp = index(args, '\n');
+ cp = strchr(args, '\n');
if (cp)
*cp = '\0';
for (;;args = cp) {
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c
index bccc93f97b6..d51730c4e38 100644
--- a/usr.bin/systat/netstat.c
+++ b/usr.bin/systat/netstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netstat.c,v 1.5 1996/08/06 18:48:15 deraadt Exp $ */
+/* $OpenBSD: netstat.c,v 1.6 1997/01/17 07:13:26 millert Exp $ */
/* $NetBSD: netstat.c,v 1.3 1995/06/18 23:53:07 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: netstat.c,v 1.5 1996/08/06 18:48:15 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: netstat.c,v 1.6 1997/01/17 07:13:26 millert Exp $";
#endif /* not lint */
/*
@@ -385,10 +385,10 @@ inetprint(in, port, proto)
char *proto;
{
struct servent *sp = 0;
- char line[80], *cp, *index();
+ char line[80], *cp;
sprintf(line, "%.*s.", 16, inetname(*in));
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
if (!nflag && port)
sp = getservbyport(port, proto);
if (sp || port == 0)
@@ -396,7 +396,7 @@ inetprint(in, port, proto)
else
sprintf(cp, "%d", ntohs((u_short)port));
/* pad to full column to clear any garbage */
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
while (cp - line < 22)
*cp++ = ' ';
*cp = '\0';
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c
index 6a1ec23ae05..f4c0e8efb2b 100644
--- a/usr.bin/talk/get_names.c
+++ b/usr.bin/talk/get_names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: get_names.c,v 1.2 1996/06/26 05:40:22 deraadt Exp $ */
+/* $OpenBSD: get_names.c,v 1.3 1997/01/17 07:13:28 millert Exp $ */
/* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: get_names.c,v 1.2 1996/06/26 05:40:22 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: get_names.c,v 1.3 1997/01/17 07:13:28 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -50,7 +50,6 @@ static char rcsid[] = "$OpenBSD: get_names.c,v 1.2 1996/06/26 05:40:22 deraadt E
char *getlogin();
char *ttyname();
-char *rindex();
extern CTL_MSG msg;
/*
@@ -88,7 +87,7 @@ get_names(argc, argv)
my_machine_name = hostname;
/* check for, and strip out, the machine name of the target */
names = strdup(argv[1]);
- for (cp = names; *cp && !index("@:!.", *cp); cp++)
+ for (cp = names; *cp && !strchr("@:!.", *cp); cp++)
;
if (*cp == '\0') {
/* this is a local to local talk */
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 1c484c0fd45..b70dfde2a98 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.3 1996/08/16 23:31:00 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.4 1997/01/17 07:13:30 millert Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: main.c,v 1.3 1996/08/16 23:31:00 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.4 1997/01/17 07:13:30 millert Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -152,8 +152,6 @@ struct cmd cmdtab[] = {
struct cmd *getcmd();
char *tail();
-char *index();
-char *rindex();
int
main(argc, argv)
@@ -340,17 +338,17 @@ put(argc, argv)
return;
}
targ = argv[argc - 1];
- if (index(argv[argc - 1], ':')) {
+ if (strchr(argv[argc - 1], ':')) {
char *cp;
struct hostent *hp;
for (n = 1; n < argc - 1; n++)
- if (index(argv[n], ':')) {
+ if (strchr(argv[n], ':')) {
putusage(argv[0]);
return;
}
cp = argv[argc - 1];
- targ = index(cp, ':');
+ targ = strchr(cp, ':');
*targ++ = 0;
hp = gethostbyname(cp);
if (hp == NULL) {
@@ -383,7 +381,7 @@ put(argc, argv)
}
/* this assumes the target is a directory */
/* on a remote unix system. hmmmm. */
- cp = index(targ, '\0');
+ cp = strchr(targ, '\0');
*cp++ = '/';
for (n = 1; n < argc - 1; n++) {
strcpy(cp, tail(argv[n]));
@@ -435,13 +433,13 @@ get(argc, argv)
}
if (!connected) {
for (n = 1; n < argc ; n++)
- if (index(argv[n], ':') == 0) {
+ if (strchr(argv[n], ':') == 0) {
getusage(argv[0]);
return;
}
}
for (n = 1; n < argc ; n++) {
- src = index(argv[n], ':');
+ src = strchr(argv[n], ':');
if (src == NULL)
src = argv[n];
else {
@@ -583,7 +581,7 @@ tail(filename)
register char *s;
while (*filename) {
- s = rindex(filename, '/');
+ s = strrchr(filename, '/');
if (s == NULL)
break;
if (s[1])
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index d813f9bc55b..faa33f7f892 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp.c,v 1.2 1996/06/26 05:40:35 deraadt Exp $ */
+/* $OpenBSD: tftp.c,v 1.3 1997/01/17 07:13:32 millert Exp $ */
/* $NetBSD: tftp.c,v 1.5 1995/04/29 05:55:25 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tftp.c,v 1.2 1996/06/26 05:40:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tftp.c,v 1.3 1997/01/17 07:13:32 millert Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -383,7 +383,6 @@ tpacket(s, tp, n)
{ "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" };
register char *cp, *file;
u_short op = ntohs(tp->th_opcode);
- char *index();
if (op < RRQ || op > ERROR)
printf("%s opcode=%x ", s, op);
@@ -395,7 +394,7 @@ tpacket(s, tp, n)
case WRQ:
n -= 2;
file = cp = tp->th_stuff;
- cp = index(cp, '\0');
+ cp = strchr(cp, '\0');
printf("<file=%s, mode=%s>\n", file, cp + 1);
break;
diff --git a/usr.bin/tip/aculib/courier.c b/usr.bin/tip/aculib/courier.c
index 1b3949c43ca..36b64b9e8c3 100644
--- a/usr.bin/tip/aculib/courier.c
+++ b/usr.bin/tip/aculib/courier.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: courier.c,v 1.3 1996/06/26 05:40:52 deraadt Exp $ */
+/* $OpenBSD: courier.c,v 1.4 1997/01/17 07:13:34 millert Exp $ */
/* $NetBSD: courier.c,v 1.5 1995/10/29 00:49:50 pk Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: courier.c,v 1.3 1996/06/26 05:40:52 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: courier.c,v 1.4 1997/01/17 07:13:34 millert Exp $";
#endif /* not lint */
/*
@@ -280,8 +280,8 @@ coursync()
buf[len] = '\0';
printf("coursync: (\"%s\")\n\r", buf);
#endif
- if (index(buf, '0') ||
- (index(buf, 'O') && index(buf, 'K')))
+ if (strchr(buf, '0') ||
+ (strchr(buf, 'O') && strchr(buf, 'K')))
return(1);
}
/*
diff --git a/usr.bin/tip/aculib/hayes.c b/usr.bin/tip/aculib/hayes.c
index ad3329bd6cb..d5b28f33859 100644
--- a/usr.bin/tip/aculib/hayes.c
+++ b/usr.bin/tip/aculib/hayes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hayes.c,v 1.4 1996/11/03 18:33:02 millert Exp $ */
+/* $OpenBSD: hayes.c,v 1.5 1997/01/17 07:13:36 millert Exp $ */
/* $NetBSD: hayes.c,v 1.5 1996/11/01 23:56:33 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: hayes.c,v 1.4 1996/11/03 18:33:02 millert Exp $";
+static char rcsid[] = "$OpenBSD: hayes.c,v 1.5 1997/01/17 07:13:36 millert Exp $";
#endif /* not lint */
/*
@@ -304,8 +304,8 @@ hay_sync()
ioctl(FD, FIONREAD, &len);
if (len) {
len = read(FD, dumbuf, min(len, DUMBUFLEN));
- if (index(dumbuf, '0') ||
- (index(dumbuf, 'O') && index(dumbuf, 'K')))
+ if (strchr(dumbuf, '0') ||
+ (strchr(dumbuf, 'O') && strchr(dumbuf, 'K')))
return(1);
#ifdef DEBUG
dumbuf[len] = '\0';
diff --git a/usr.bin/tip/aculib/t3000.c b/usr.bin/tip/aculib/t3000.c
index ae704882457..57a3a10fb1f 100644
--- a/usr.bin/tip/aculib/t3000.c
+++ b/usr.bin/tip/aculib/t3000.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t3000.c,v 1.3 1996/06/26 05:40:54 deraadt Exp $ */
+/* $OpenBSD: t3000.c,v 1.4 1997/01/17 07:13:37 millert Exp $ */
/* $NetBSD: t3000.c,v 1.3 1995/10/29 00:49:57 pk Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)t3000.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: t3000.c,v 1.3 1996/06/26 05:40:54 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: t3000.c,v 1.4 1997/01/17 07:13:37 millert Exp $";
#endif /* not lint */
/*
@@ -298,8 +298,8 @@ if (len == 0) len = 1;
buf[len] = '\0';
printf("t3000_sync: (\"%s\")\n\r", buf);
#endif
- if (index(buf, '0') ||
- (index(buf, 'O') && index(buf, 'K')))
+ if (strchr(buf, '0') ||
+ (strchr(buf, 'O') && strchr(buf, 'K')))
return(1);
}
/*
diff --git a/usr.bin/tip/aculib/ventel.c b/usr.bin/tip/aculib/ventel.c
index e46498006af..a885710ce52 100644
--- a/usr.bin/tip/aculib/ventel.c
+++ b/usr.bin/tip/aculib/ventel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ventel.c,v 1.3 1996/06/26 05:40:57 deraadt Exp $ */
+/* $OpenBSD: ventel.c,v 1.4 1997/01/17 07:13:38 millert Exp $ */
/* $NetBSD: ventel.c,v 1.4 1995/10/29 00:50:04 pk Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)ventel.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ventel.c,v 1.3 1996/06/26 05:40:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ventel.c,v 1.4 1997/01/17 07:13:38 millert Exp $";
#endif /* not lint */
/*
@@ -71,7 +71,7 @@ ven_dialer(num, acu)
{
register char *cp;
register int connected = 0;
- char *msg, *index(), line[80];
+ char *msg, line[80];
static int gobble(), vensync();
static void echo();
struct termios cntrl;
@@ -115,10 +115,10 @@ ven_dialer(num, acu)
if (connected || timeout || !boolean(value(VERBOSE)))
return (connected);
/* call failed, parse response for user */
- cp = index(line, '\r');
+ cp = strchr(line, '\r');
if (cp)
*cp = '\0';
- for (cp = line; cp = index(cp, ' '); cp++)
+ for (cp = line; cp = strchr(cp, ' '); cp++)
if (cp[1] == ' ')
break;
if (cp) {
diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c
index 89da12674bb..a4121f0ad3a 100644
--- a/usr.bin/tr/str.c
+++ b/usr.bin/tr/str.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: str.c,v 1.2 1996/06/26 05:41:49 deraadt Exp $ */
+/* $OpenBSD: str.c,v 1.3 1997/01/17 07:13:40 millert Exp $ */
/* $NetBSD: str.c,v 1.7 1995/08/31 22:13:47 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95";
#endif
-static char rcsid[] = "$OpenBSD: str.c,v 1.2 1996/06/26 05:41:49 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: str.c,v 1.3 1997/01/17 07:13:40 millert Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
@@ -141,7 +141,7 @@ bracket(s)
default: /* "[\###*n]" or "[#*n]" */
if ((p = strpbrk(s->str + 2, "*]")) == NULL)
return (0);
- if (p[0] != '*' || index(p, ']') == NULL)
+ if (p[0] != '*' || strchr(p, ']') == NULL)
return (0);
s->str += 1;
genseq(s);
diff --git a/usr.bin/tset/map.c b/usr.bin/tset/map.c
index 6b8e1b7f649..bbe63ddd2c0 100644
--- a/usr.bin/tset/map.c
+++ b/usr.bin/tset/map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: map.c,v 1.2 1996/06/26 05:41:55 deraadt Exp $ */
+/* $OpenBSD: map.c,v 1.3 1997/01/17 07:13:43 millert Exp $ */
/* $NetBSD: map.c,v 1.4 1994/12/07 05:08:07 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/9/93";
#endif
-static char rcsid[] = "$OpenBSD: map.c,v 1.2 1996/06/26 05:41:55 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: map.c,v 1.3 1997/01/17 07:13:43 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -136,7 +136,7 @@ next: if (*arg == ':') {
goto badmopt;
++arg;
} else { /* Optional baudrate. */
- arg = index(p = arg, ':');
+ arg = strchr(p = arg, ':');
if (arg == NULL)
goto badmopt;
*arg++ = '\0';
diff --git a/usr.bin/tset/term.c b/usr.bin/tset/term.c
index a773f92fd24..e1c0f0bf2da 100644
--- a/usr.bin/tset/term.c
+++ b/usr.bin/tset/term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term.c,v 1.2 1996/06/26 05:41:57 deraadt Exp $ */
+/* $OpenBSD: term.c,v 1.3 1997/01/17 07:13:44 millert Exp $ */
/* $NetBSD: term.c,v 1.6 1994/12/07 05:08:12 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93";
#endif
-static char rcsid[] = "$OpenBSD: term.c,v 1.2 1996/06/26 05:41:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: term.c,v 1.3 1997/01/17 07:13:44 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -78,7 +78,7 @@ get_termcap_entry(userarg, tcapbufp)
/* Try ttyname(3); check for dialup or other mapping. */
if (ttypath = ttyname(STDERR_FILENO)) {
- if (p = rindex(ttypath, '/'))
+ if (p = strrchr(ttypath, '/'))
++p;
else
p = ttypath;
@@ -151,7 +151,7 @@ askuser(dflt)
return (dflt);
}
- if (p = index(answer, '\n'))
+ if (p = strchr(answer, '\n'))
*p = '\0';
if (answer[0])
return (answer);
diff --git a/usr.bin/tset/wrterm.c b/usr.bin/tset/wrterm.c
index 9fb1b10854e..be06c172545 100644
--- a/usr.bin/tset/wrterm.c
+++ b/usr.bin/tset/wrterm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wrterm.c,v 1.2 1996/06/26 05:41:59 deraadt Exp $ */
+/* $OpenBSD: wrterm.c,v 1.3 1997/01/17 07:13:45 millert Exp $ */
/* $NetBSD: wrterm.c,v 1.3 1994/12/07 05:08:16 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)wrterm.c 8.1 (Berkeley) 6/9/93";
#endif
-static char rcsid[] = "$OpenBSD: wrterm.c,v 1.2 1996/06/26 05:41:59 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: wrterm.c,v 1.3 1997/01/17 07:13:45 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -60,7 +60,7 @@ wrtermcap(bp)
char *t, *sep;
/* Find the end of the terminal names. */
- if ((t = index(bp, ':')) == NULL)
+ if ((t = strchr(bp, ':')) == NULL)
err("termcap names not colon terminated");
*t++ = '\0';
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index 8225aff90c0..5b6d750dc4f 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uudecode.c,v 1.2 1996/06/26 05:42:21 deraadt Exp $ */
+/* $OpenBSD: uudecode.c,v 1.3 1997/01/17 07:13:47 millert Exp $ */
/* $NetBSD: uudecode.c,v 1.6 1994/11/17 07:40:43 jtc Exp $ */
/*-
@@ -42,7 +42,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)uudecode.c 8.2 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: uudecode.c,v 1.2 1996/06/26 05:42:21 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: uudecode.c,v 1.3 1997/01/17 07:13:47 millert Exp $";
#endif /* not lint */
/*
@@ -119,7 +119,7 @@ decode()
/* handle ~user/file format */
if (buf[0] == '~') {
- if (!(p = index(buf, '/'))) {
+ if (!(p = strchr(buf, '/'))) {
(void)fprintf(stderr, "uudecode: %s: illegal ~user.\n",
filename);
return(1);
diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c
index b04d24a4fe4..e9ccc2a6063 100644
--- a/usr.bin/vacation/vacation.c
+++ b/usr.bin/vacation/vacation.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vacation.c,v 1.4 1997/01/15 23:43:31 millert Exp $ */
+/* $OpenBSD: vacation.c,v 1.5 1997/01/17 07:13:48 millert Exp $ */
/* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)vacation.c 8.2 (Berkeley) 1/26/94";
#endif
-static char rcsid[] = "$OpenBSD: vacation.c,v 1.4 1997/01/15 23:43:31 millert Exp $";
+static char rcsid[] = "$OpenBSD: vacation.c,v 1.5 1997/01/17 07:13:48 millert Exp $";
#endif /* not lint */
/*
@@ -216,7 +216,7 @@ readheaders()
for (p = buf + 5; *p && *p != ' '; ++p);
*p = '\0';
(void)strcpy(from, buf + 5);
- if (p = index(from, '\n'))
+ if (p = strchr(from, '\n'))
*p = '\0';
if (junkmail())
exit(0);
@@ -227,7 +227,7 @@ readheaders()
if (strncasecmp(buf, "Precedence", 10) ||
buf[10] != ':' && buf[10] != ' ' && buf[10] != '\t')
break;
- if (!(p = index(buf, ':')))
+ if (!(p = strchr(buf, ':')))
break;
while (*++p && isspace(*p));
if (!*p)
@@ -305,9 +305,9 @@ junkmail()
*
* From site!site!SENDER%site.domain%site.domain@site.domain
*/
- if (!(p = index(from, '%')))
- if (!(p = index(from, '@'))) {
- if (p = rindex(from, '!'))
+ if (!(p = strchr(from, '%')))
+ if (!(p = strchr(from, '@'))) {
+ if (p = strrchr(from, '!'))
++p;
else
p = from;
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c
index a5537513eb9..cf32afd62fb 100644
--- a/usr.bin/who/who.c
+++ b/usr.bin/who/who.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: who.c,v 1.2 1996/06/26 05:43:00 deraadt Exp $ */
+/* $OpenBSD: who.c,v 1.3 1997/01/17 07:13:50 millert Exp $ */
/* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: who.c,v 1.2 1996/06/26 05:43:00 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: who.c,v 1.3 1997/01/17 07:13:50 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -148,7 +148,7 @@ who_am_i(ufp)
/* search through the utmp and find an entry for this tty */
if (p = ttyname(0)) {
/* strip any directory component */
- if (t = rindex(p, '/'))
+ if (t = strrchr(p, '/'))
p = t + 1;
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1)
if (usr.ut_name && !strcmp(usr.ut_line, p)) {
diff --git a/usr.bin/window/lcmd1.c b/usr.bin/window/lcmd1.c
index 0b7d1110ebd..4618724713a 100644
--- a/usr.bin/window/lcmd1.c
+++ b/usr.bin/window/lcmd1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcmd1.c,v 1.3 1996/06/26 05:43:15 deraadt Exp $ */
+/* $OpenBSD: lcmd1.c,v 1.4 1997/01/17 07:13:51 millert Exp $ */
/* $NetBSD: lcmd1.c,v 1.6 1996/02/08 20:45:00 mycroft Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lcmd1.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lcmd1.c,v 1.3 1996/06/26 05:43:15 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: lcmd1.c,v 1.4 1997/01/17 07:13:51 millert Exp $";
#endif
#endif /* not lint */
@@ -109,7 +109,7 @@ register struct value *a;
*pp = a->v_str;
*pp = 0;
shf = *(sh = argv);
- if (*sh = rindex(shf, '/'))
+ if (*sh = strrchr(shf, '/'))
(*sh)++;
else
*sh = shf;
diff --git a/usr.bin/window/lcmd2.c b/usr.bin/window/lcmd2.c
index 6b7d8a22afb..6a012bbcd97 100644
--- a/usr.bin/window/lcmd2.c
+++ b/usr.bin/window/lcmd2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcmd2.c,v 1.2 1996/06/26 05:43:15 deraadt Exp $ */
+/* $OpenBSD: lcmd2.c,v 1.3 1997/01/17 07:13:52 millert Exp $ */
/* $NetBSD: lcmd2.c,v 1.7 1995/09/29 00:44:04 cgd Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lcmd2.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lcmd2.c,v 1.2 1996/06/26 05:43:15 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: lcmd2.c,v 1.3 1997/01/17 07:13:52 millert Exp $";
#endif
#endif /* not lint */
@@ -285,7 +285,7 @@ l_def_shell(v, a)
break;
}
if (default_shellfile = *default_shell)
- if (*default_shell = rindex(default_shellfile, '/'))
+ if (*default_shell = strrchr(default_shellfile, '/'))
(*default_shell)++;
else
*default_shell = default_shellfile;
diff --git a/usr.bin/window/main.c b/usr.bin/window/main.c
index 4f2303676bd..422a5ef0390 100644
--- a/usr.bin/window/main.c
+++ b/usr.bin/window/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.4 1996/06/26 05:43:17 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.5 1997/01/17 07:13:52 millert Exp $ */
/* $NetBSD: main.c,v 1.6 1996/02/08 20:45:01 mycroft Exp $ */
/*
@@ -47,7 +47,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.4 1996/06/26 05:43:17 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.5 1997/01/17 07:13:52 millert Exp $";
#endif
#endif /* not lint */
@@ -72,7 +72,7 @@ char **argv;
char tflag = 0;
escapec = ESCAPEC;
- if (p = rindex(*argv, '/'))
+ if (p = strrchr(*argv, '/'))
p++;
else
p = *argv;
@@ -118,7 +118,7 @@ char **argv;
(void) fprintf(stderr, "Out of memory.\n");
exit(1);
}
- if (p = rindex(default_shellfile, '/'))
+ if (p = strrchr(default_shellfile, '/'))
p++;
else
p = default_shellfile;
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 05fb9f3ba61..309eff38bf5 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xinstall.c,v 1.10 1997/01/15 23:43:41 millert Exp $ */
+/* $OpenBSD: xinstall.c,v 1.11 1997/01/17 07:13:54 millert Exp $ */
/* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
-static char rcsid[] = "$OpenBSD: xinstall.c,v 1.10 1997/01/15 23:43:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: xinstall.c,v 1.11 1997/01/17 07:13:54 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -228,7 +228,7 @@ install(from_name, to_name, fset, flags)
if (flags & DIRECTORY) {
(void)snprintf(pathbuf, sizeof(pathbuf), "%s/%s",
to_name,
- (p = rindex(from_name, '/')) ? ++p : from_name);
+ (p = strrchr(from_name, '/')) ? ++p : from_name);
to_name = pathbuf;
}
devnull = 0;
diff --git a/usr.bin/yacc/test/ftp.tab.c b/usr.bin/yacc/test/ftp.tab.c
index 177b1f9ea5b..071970fe365 100644
--- a/usr.bin/yacc/test/ftp.tab.c
+++ b/usr.bin/yacc/test/ftp.tab.c
@@ -1,6 +1,6 @@
#ifndef lint
/*static char yysccsid[] = "from: @(#)yaccpar 1.9 (Berkeley) 02/21/93";*/
-static char yyrcsid[] = "$OpenBSD: ftp.tab.c,v 1.2 1996/04/21 23:45:32 deraadt Exp $";
+static char yyrcsid[] = "$OpenBSD: ftp.tab.c,v 1.3 1997/01/17 07:13:55 millert Exp $";
#endif
#include <stdlib.h>
#define YYBYACC 1
@@ -16,7 +16,7 @@ static char yyrcsid[] = "$OpenBSD: ftp.tab.c,v 1.2 1996/04/21 23:45:32 deraadt E
#ifndef lint
/*static char sccsid[] = "from: @(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89";*/
-static char rcsid[] = "$Id: ftp.tab.c,v 1.2 1996/04/21 23:45:32 deraadt Exp $";
+static char rcsid[] = "$Id: ftp.tab.c,v 1.3 1997/01/17 07:13:55 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -60,7 +60,6 @@ static int cmd_bytesz;
char cbuf[512];
char *fromname;
-char *index();
#line 65 "ftp.tab.c"
#define A 257
#define B 258
@@ -586,7 +585,7 @@ yylex()
if (strncasecmp(cbuf, "PASS", 4) != NULL)
setproctitle("%s: %s", proctitle, cbuf);
#endif /* SETPROCTITLE */
- if ((cp = index(cbuf, '\r'))) {
+ if ((cp = strchr(cbuf, '\r'))) {
*cp++ = '\n';
*cp = '\0';
}