Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mail Use strpbrk(3) instead of anyof().



details:   https://anonhg.NetBSD.org/src/rev/df995e584295
branches:  trunk
changeset: 523184:df995e584295
user:      wiz <wiz%NetBSD.org@localhost>
date:      Tue Mar 05 19:25:16 2002 +0000

description:
Use strpbrk(3) instead of anyof().

diffstat:

 usr.bin/mail/extern.h  |   5 ++---
 usr.bin/mail/fio.c     |   6 +++---
 usr.bin/mail/support.c |  17 ++---------------
 3 files changed, 7 insertions(+), 21 deletions(-)

diffs (91 lines):

diff -r a21b46c75fed -r df995e584295 usr.bin/mail/extern.h
--- a/usr.bin/mail/extern.h     Tue Mar 05 19:17:44 2002 +0000
+++ b/usr.bin/mail/extern.h     Tue Mar 05 19:25:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.13 2002/03/02 14:59:38 wiz Exp $  */
+/*     $NetBSD: extern.h,v 1.14 2002/03/05 19:25:16 wiz Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)extern.h    8.2 (Berkeley) 4/20/95 
- *     $NetBSD: extern.h,v 1.13 2002/03/02 14:59:38 wiz Exp $
+ *     $NetBSD: extern.h,v 1.14 2002/03/05 19:25:16 wiz Exp $
  */
 
 struct name;
@@ -89,7 +89,6 @@
 void    alter(char *);
 int     alternates(void *);
 void    announce(void);
-int     anyof(char *, char *);
 int     append(struct message *, FILE *);
 int     argcount(char **);
 void    assign(char [], char []);
diff -r a21b46c75fed -r df995e584295 usr.bin/mail/fio.c
--- a/usr.bin/mail/fio.c        Tue Mar 05 19:17:44 2002 +0000
+++ b/usr.bin/mail/fio.c        Tue Mar 05 19:25:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fio.c,v 1.17 2002/03/04 03:07:25 wiz Exp $     */
+/*     $NetBSD: fio.c,v 1.18 2002/03/05 19:25:16 wiz Exp $     */
 
 /*
  * Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)fio.c      8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: fio.c,v 1.17 2002/03/04 03:07:25 wiz Exp $");
+__RCSID("$NetBSD: fio.c,v 1.18 2002/03/05 19:25:16 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -368,7 +368,7 @@
                snprintf(xname, PATHSIZE, "%s%s", homedir, name + 1);
                name = savestr(xname);
        }
-       if (!anyof(name, "~{[*?$`'\"\\"))
+       if (strpbrk(name, "~{[*?$`'\"\\") == NULL)
                return name;
        if (pipe(pivec) < 0) {
                perror("pipe");
diff -r a21b46c75fed -r df995e584295 usr.bin/mail/support.c
--- a/usr.bin/mail/support.c    Tue Mar 05 19:17:44 2002 +0000
+++ b/usr.bin/mail/support.c    Tue Mar 05 19:25:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: support.c,v 1.4 2002/03/04 03:07:27 wiz Exp $  */
+/*     $NetBSD: support.c,v 1.5 2002/03/05 19:25:16 wiz Exp $  */
 
 /*
  * Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)aux.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: support.c,v 1.4 2002/03/04 03:07:27 wiz Exp $");
+__RCSID("$NetBSD: support.c,v 1.5 2002/03/05 19:25:16 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -588,19 +588,6 @@
 }
 
 /*
- * Are any of the characters in the two strings the same?
- */
-int
-anyof(char *s1, char *s2)
-{
-
-       while (*s1)
-               if (strchr(s2, *s1++))
-                       return 1;
-       return 0;
-}
-
-/*
  * Convert c to upper case
  */
 int



Home | Main Index | Thread Index | Old Index