remove call of _fwalk
[unix-history] / usr / src / usr.bin / mail / cmd3.c
index 4b661c8..c890540 100644 (file)
@@ -2,21 +2,11 @@
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)cmd3.c     5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmd3.c     5.24 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "rcv.h"
 #endif /* not lint */
 
 #include "rcv.h"
@@ -34,8 +24,7 @@ static char sccsid[] = "@(#)cmd3.c    5.18 (Berkeley) %G%";
 shell(str)
        char *str;
 {
 shell(str)
        char *str;
 {
-       int (*sigint)() = signal(SIGINT, SIG_IGN);
-       int (*sigcont)() = signal(SIGCONT, SIG_DFL);
+       sig_t sigint = signal(SIGINT, SIG_IGN);
        char *shell;
        char cmd[BUFSIZ];
 
        char *shell;
        char cmd[BUFSIZ];
 
@@ -43,10 +32,9 @@ shell(str)
        if (bangexp(cmd) < 0)
                return 1;
        if ((shell = value("SHELL")) == NOSTR)
        if (bangexp(cmd) < 0)
                return 1;
        if ((shell = value("SHELL")) == NOSTR)
-               shell = SHELL;
+               shell = _PATH_CSHELL;
        (void) run_command(shell, 0, -1, -1, "-c", cmd, NOSTR);
        (void) signal(SIGINT, sigint);
        (void) run_command(shell, 0, -1, -1, "-c", cmd, NOSTR);
        (void) signal(SIGINT, sigint);
-       (void) signal(SIGCONT, sigcont);
        printf("!\n");
        return 0;
 }
        printf("!\n");
        return 0;
 }
@@ -58,15 +46,13 @@ shell(str)
 dosh(str)
        char *str;
 {
 dosh(str)
        char *str;
 {
-       int (*sigint)() = signal(SIGINT, SIG_IGN);
-       int (*sigcont)() = signal(SIGCONT, SIG_DFL);
+       sig_t sigint = signal(SIGINT, SIG_IGN);
        char *shell;
 
        if ((shell = value("SHELL")) == NOSTR)
        char *shell;
 
        if ((shell = value("SHELL")) == NOSTR)
-               shell = SHELL;
+               shell = _PATH_CSHELL;
        (void) run_command(shell, 0, -1, -1, NOSTR);
        (void) signal(SIGINT, sigint);
        (void) run_command(shell, 0, -1, -1, NOSTR);
        (void) signal(SIGINT, sigint);
-       (void) signal(SIGCONT, sigcont);
        putchar('\n');
        return 0;
 }
        putchar('\n');
        return 0;
 }
@@ -134,13 +120,13 @@ help()
        register c;
        register FILE *f;
 
        register c;
        register FILE *f;
 
-       if ((f = fopen(HELPFILE, "r")) == NULL) {
-               perror(HELPFILE);
+       if ((f = Fopen(_PATH_HELP, "r")) == NULL) {
+               perror(_PATH_HELP);
                return(1);
        }
        while ((c = getc(f)) != EOF)
                putchar(c);
                return(1);
        }
        while ((c = getc(f)) != EOF)
                putchar(c);
-       fclose(f);
+       Fclose(f);
        return(0);
 }
 
        return(0);
 }
 
@@ -518,16 +504,12 @@ null(e)
 file(argv)
        register char **argv;
 {
 file(argv)
        register char **argv;
 {
-       char *cp;
 
        if (argv[0] == NOSTR) {
                newfileinfo();
                return 0;
        }
 
        if (argv[0] == NOSTR) {
                newfileinfo();
                return 0;
        }
-       if ((cp = expand(*argv)) == NOSTR)
-               return 1;
-       strcpy(prevfile, mailname);
-       if (setfile(cp, **argv != '%') < 0)
+       if (setfile(*argv) < 0)
                return 1;
        announce();
        return 0;
                return 1;
        announce();
        return 0;